Solved

iOS: Binary doesn’t include the SKPaymentTransactionObserver method.

  • 23 July 2021
  • 4 replies
  • 145 views

Badge +1

My IAP Promotions were being held because my binary  “did not include the SKPaymentTransactionObserver method” I haven’t seen anything like this before. I had presumed that this would be included in the Purchases package. Am I missing something, or did Apple? Thanks

icon

Best answer by Bry 24 July 2021, 19:00

View original

4 replies

Userlevel 3
Badge +8

According to this StackOverflow question it seems like it may be an issue on Apple’s end. It may be worth to contact Apple Developer Support to see if they can help out.

If that doesn’t help, can you share the version and SDK (native, Flutter, etc.) you’re using?

Userlevel 3
Badge +8

The team also mentioned that you should confirm that you implemented the shouldPurchasePromoProduct delegate method of PurchasesDelegate:. First add the AppDelegate as a PurchasesDelegate:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

Purchases.configure(withAPIKey: API_KEY)

/// - Set the delegate to this instance of AppDelegate.
Purchases.shared.delegate = self

return true
}

 Then implement the delegate function in AppDelegate:

func purchases(_ purchases: Purchases, shouldPurchasePromoProduct product: SKProduct, defermentBlock makeDeferredPurchase: @escaping RCDeferredPromotionalPurchaseBlock) {
makeDeferredPurchase { (transaction, info, error, cancelled) in
if let purchaserInfo = info {
handlePurchaserInfo()
}
}
}

There’s a little more information on shouldPurchasePromoProduct in our guide on configuring the SDK.

Userlevel 3
Badge +8

There’s a bit more sample code here if that ends up being the issue: https://github.com/RevenueCat/purchases-ios/issues/651#issuecomment-880272931

Badge +1

Thanks for the quick response. The issue was on my end with not properly implementing the `shouldPurchasePromoProduct`. If anyone else is looking to this answer to help implement it, I also found this StackOverflow question that helped a great deal. The biggest takeaway from this was understanding how the transaction is completed. The answer explained:

“Note that you don't have to call purchaseProduct inside the block. Calling the block will be equivalent to calling purchaseProduct and it will open the purchase dialog.”

That was where I was stuck in my implementation.

Reply