Skip to main content
Solved

iOS: Binary doesn’t include the SKPaymentTransactionObserver method.

  • Jul 23, 2021 8:06 PM UTC
  • 5 replies
  • 1691 views

Forum|alt.badge.img+3

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

Best answer by Bry

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.

View original
This post has been closed for comments

5 replies

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • Jul 23, 2021 10:21 PM UTC

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?


sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • Jul 23, 2021 10:43 PM UTC

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.


sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • Jul 23, 2021 10:47 PM UTC

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


Forum|alt.badge.img+3
  • Author
  • Helper
  • Answer
  • Jul 24, 2021 5:00 PM UTC

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.


Forum|alt.badge.img+6
  • Member
  • Jun 2, 2022 9:03 AM UTC

Hello,

Is there a way to use “App Store Promotions In-app purchase” without native code for such as Flutter app?

Thank you!