Describe the bug
Purchases is calling "AAAttribution.attributionToken()" on the main queue. When the device is not connected to the internet, this call takes a while (is it doing a network call?).
- I first worked around this issue by calling
Purchases.shared.attribution.enableAdServicesAttributionTokenCollection() off the main thread.
- however, Purchases is calling
self.attribution.postAdServicesTokenOncePerInstallIfNeeded() when the app is entering foreground, blocking the main queue.
-
Environment
- Platform: iOS
- SDK version: 4.27.1
- StoreKit version:
- OS version: 15.6.1
- Xcode version:
- Device and/or simulator:
- Environment:
- How widespread is the issue. Percentage of devices affected.
-
Steps to reproduce, with a description of expected vs. actual behavior
- delete test app.
- put device in Airplane mode.
- start app, go to background, go to foreground.
- Notice blockages.
- Other information
#0 0x00000001b7a474a0 in mach_msg_trap ()
#1 0x00000001b7a47ae4 in mach_msg ()
#2 0x000000010540305c in _dispatch_mach_send_and_wait_for_reply ()
#3 0x00000001054033e4 in dispatch_mach_send_with_result_and_wait_for_reply ()
#4 0x00000001f1254f0c in xpc_connection_send_message_with_reply_sync ()
#5 0x00000001822b0c4c in __NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__ ()
#6 0x00000001822b6d1c in -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] ()
#7 0x00000001822ca514 in -[NSXPCConnection _sendSelector:withProxy:arg1:] ()
#8 0x000000018229bdf0 in _NSXPCDistantObjectSimpleMessageSend1 ()
#9 0x00000001f1e58060 in ___lldb_unnamed_symbol38 ()
#10 0x000000010176ee28 in AttributionFetcher.adServicesToken.getter at /Users/ronyfadel/Library/Developer/Xcode/DerivedData/VidCap-bwtrrsrmwbcpyyczvixlxumnkjsc/SourcePackages/checkouts/purchases-ios/Sources/Attribution/AttributionFetcher.swift:99
#11 0x0000000101773dd8 in AttributionPoster.adServicesTokenToPostIfNeeded.getter at /Users/ronyfadel/Library/Developer/Xcode/DerivedData/VidCap-bwtrrsrmwbcpyyczvixlxumnkjsc/SourcePackages/checkouts/purchases-ios/Sources/Attribution/AttributionPoster.swift:148
#12 0x0000000101773c90 in AttributionPoster.postAdServicesTokenOncePerInstallIfNeeded() at /Users/ronyfadel/Library/Developer/Xcode/DerivedData/VidCap-bwtrrsrmwbcpyyczvixlxumnkjsc/SourcePackages/checkouts/purchases-ios/Sources/Attribution/AttributionPoster.swift:131
#13 0x000000010194d838 in Attribution.postAdServicesTokenOncePerInstallIfNeeded() at /Users/ronyfadel/Library/Developer/Xcode/DerivedData/VidCap-bwtrrsrmwbcpyyczvixlxumnkjsc/SourcePackages/checkouts/purchases-ios/Sources/Purchasing/Purchases/Attribution.swift:72
#14 0x00000001019638b8 in Purchases.applicationWillEnterForeground() at /Users/ronyfadel/Library/Developer/Xcode/DerivedData/VidCap-bwtrrsrmwbcpyyczvixlxumnkjsc/SourcePackages/checkouts/purchases-ios/Sources/Purchasing/Purchases/Purchases.swift:1504
#15 0x0000000101963bd0 in @objc Purchases.applicationWillEnterForeground() ()
Describe the bug
Purchases is calling "AAAttribution.attributionToken()" on the main queue. When the device is not connected to the internet, this call takes a while (is it doing a network call?).
Purchases.shared.attribution.enableAdServicesAttributionTokenCollection()off the main thread.self.attribution.postAdServicesTokenOncePerInstallIfNeeded()when the app is entering foreground, blocking the main queue.Environment
usesStoreKit2IfAvailable(true))Steps to reproduce, with a description of expected vs. actual behavior