Support didRevokeEntitlementsForProductIdentifiers#71
Support didRevokeEntitlementsForProductIdentifiers#71MikeChongCan wants to merge 2 commits intobenjaminmayo:masterfrom
Conversation
| @@ -0,0 +1,48 @@ | |||
| { | |||
There was a problem hiding this comment.
Need inputs: Not sure whether we need this .storekit configuration file for the example?
| _ = self.configuration.storage.removeRecord(forProductIdentifier: product.identifier) | ||
| } | ||
| case .failure(let error): | ||
| self.logger.log(message: "\(error)", category: .tasks) |
There was a problem hiding this comment.
.failure is always the result. Not sure where I can fix it?
There was a problem hiding this comment.
Prolly, sorry haven't had a chance to investigate that ticket yet.
| public func merchantDidChangeLoadingState(_ merchant: Merchant) { | ||
| UIApplication.shared.isNetworkActivityIndicatorVisible = merchant.isLoading | ||
| DispatchQueue.main.async { | ||
| UIApplication.shared.isNetworkActivityIndicatorVisible = merchant.isLoading |
There was a problem hiding this comment.
Do you have the full call stack here?
There was a problem hiding this comment.
This delegate should always be called from the main thread so the bug here is inside MerchantKit itself, not the example proj.
There was a problem hiding this comment.
Oh, it's my fault!
Thread 2 Queue : com.apple.NSXPCConnection.m-user.com.apple.storekitservice (serial)
#0 0x000000010c4913f0 in AppDelegate.merchantDidChangeLoadingState(_:) at merchantkit/Example/Source/AppDelegate.swift:57
#1 0x000000010c4914a9 in protocol witness for MerchantDelegate.merchantDidChangeLoadingState(_:) in conformance AppDelegate ()
#2 0x000000010c7718c8 in Merchant.updateLoadingStateIfNecessary() at merchantkit/Source/Merchant.swift:200
#3 0x000000010c76f450 in Merchant.checkReceipt(updateProducts:policy:reason:completion:) at merchantkit/Source/Merchant.swift:276
#4 0x000000010c77b420 in Merchant.storeInterface(_:didRevokeEntitlementsForProductIdentifiers:) at merchantkit/Source/Merchant.swift:510
#5 0x000000010c77c2f9 in protocol witness for StoreInterfaceDelegate.storeInterface(_:didRevokeEntitlementsForProductIdentifiers:) in conformance Merchant ()
#6 0x000000010c7b0e1d in StoreKitTransactionObserver.paymentQueue(_:didRevokeEntitlementsForProductIdentifiers:) at merchantkit/Source/Internal/StoreKitStoreInterface/StoreKitTransactionObserver.swift:94
#7 0x000000010c7b0ed0 in @objc StoreKitTransactionObserver.paymentQueue(_:didRevokeEntitlementsForProductIdentifiers:) ()
#8 0x00007fff307898e9 in __59-[SKPaymentQueue removedEntitlementsForProductIdentifiers:]_block_invoke ()
#9 0x00007fff20393eaf in __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ ()
#10 0x00007fff20320507 in -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] ()
#11 0x00007fff3078984f in -[SKPaymentQueue removedEntitlementsForProductIdentifiers:] ()
#12 0x00007fff367eca23 in -[ASDStoreKitClientBroker removedEntitlementsForProductIdentifiers:] ()
#13 0x00007fff2092cbd7 in __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S1__ ()
#14 0x00007fff2092b90f in -[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] ()
#15 0x00007fff2092cf06 in message_handler ()
#16 0x00007fff20056cf8 in _xpc_connection_call_event_handler ()
#17 0x00007fff2005707c in _xpc_connection_mach_event ()
#18 0x000000010d5717ee in _dispatch_client_callout4 ()
#19 0x000000010d58b80a in _dispatch_mach_msg_invoke ()
#20 0x000000010d577db1 in _dispatch_lane_serial_drain ()
#21 0x000000010d58c6c8 in _dispatch_mach_invoke ()
#22 0x000000010d577db1 in _dispatch_lane_serial_drain ()
#23 0x000000010d578c9d in _dispatch_lane_invoke ()
#24 0x000000010d584a7a in _dispatch_workloop_worker_thread ()
#25 0x00007fff603404c0 in _pthread_wqthread ()
#26 0x00007fff6033f493 in start_wqthread ()
Will fix it by wrap the delegate call back in main thread block.
|
If you want to merge against master, the receipt validation issue for Xcode Store Kit Test Configuration generated receipts should be resolved. |
Sure! Thanks for letting me know! Will check this PR during my weekend. |

In a WWDC 20 session, StoreKit testing was introduced.
This PR aims to support revoking IAP.