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
iOS: Binary doesn’t include the SKPaymentTransactionObserver method.
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?
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.
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
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.
Hello,
Is there a way to use “App Store Promotions In-app purchase” without native code for such as Flutter app?
Thank you!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.