j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.29k stars 529 forks source link

Are there plans for adding SKPaymentTransactionObserver for iOS 11? #608

Closed maikelsgit closed 5 years ago

maikelsgit commented 6 years ago

Are there plans for adding SKPaymentTransactionObserver for the coming iOS 11 release. See this apple developer page for more info about it

In short: With iOS 11, users can browse in-app purchases directly on the App Store and start a purchase even before downloading your app. Promoted in-app purchases appear on your product page, can display in search results, and may be featured on the Today, Games, and Apps tabs. Learn how to effectively increase discoverability for content previously only found inside your app.

Chuckv01 commented 6 years ago

+1 This functionality will be great for ASO. Hopefully it will get added.

rafaellop commented 6 years ago

This is becoming more urgent than I thought. In this place I'd like to warn all iOS developers who use the cordova-purchase plugin and the author @j3k0, NOT to add the "App Store Promotion (Optional)" image in the in-app product page on the developers dashboard for iaps. If you add it and submit the iap product for review, it will be returned to the dashboard and it cannot be sold in the app! It happened to me today.

The Apple's explanation for this return is "These in-app purchases can’t be promoted on the App Store because your latest app binary doesn’t include the SKPaymentTransactionObserver method.". And the method they refer to is this: https://developer.apple.com/documentation/storekit/skpaymenttransactionobserver/2877502-paymentqueue

In a a typical case it would be enough just to go to the developer dashboard, remove the image to turn off the promotion, but not in the Apple's case. If you define the image you cannot remove it and you have no sales. Well, you can and you can save, but then it magically comes back and the IAP cannot be fixed. The only way at the moment is to create a new iap product and submit new version of the app to the appstore.

Dexus commented 6 years ago

See https://github.com/j3k0/cordova-plugin-purchase/tree/fix/ios-early-observer

Dexus commented 6 years ago

@j3k0 is working on it.

rafaellop commented 6 years ago

@Dexus do you think I could try the branch to submit new build and they'll consider it as including the required method? I can try.

Dexus commented 6 years ago

You can test it. More test = more feedback.

Von meinem iPhone gesendet

Am 18.10.2017 um 11:33 schrieb rafaellop notifications@github.com:

@Dexus do you think I could try the branch to submit new build and they'll consider it as including the required method? I can try.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

rafaellop commented 6 years ago

So I submitted a new build for the review. I'll let you know the results.

j3k0 commented 6 years ago

Hi, @Dexus the PR you're referring to is about making sure the transaction observer is added even before the JS initializes the plugin (it seems like from iOS version something some purchases were reported "too earlier" -- read before JS initialization)

This iOS 11 feature requires a specific method to be added to the observer: https://developer.apple.com/documentation/storekit/skpaymenttransactionobserver/2877502-paymentqueue?language=objc

This delegate method is called when the user starts an in-app purchase in the App Store, and the transaction continues in your app. Specifically, if your app is already installed, the method is called automatically. If your app is not yet installed when the user starts the in-app purchase in the App Store, the user gets a notification when the app installation is complete. This method is called when the user taps the notification. Otherwise, if the user opens the app manually, this method is called only if the app is opened soon after the purchase was started.

Seems like a simple implementation that returns "false" might be a Okay fix for the moment.

Dexus commented 6 years ago

Oh, okay, I had somehow put it in context with that.

j3k0 commented 6 years ago

Please check out PR #637, hopefully it should fix this issue.

rafaellop commented 6 years ago

I have submitted my app with the plugin from the ios-early-observer branch yesterday and it didn't fix the review notice about missing support for the skpaymenttransactionobserver. I'll try again with the new PR when it is accepted to the branch.

rafaellop commented 6 years ago

I've tried the @j3k0 branch and the appstore doesn't complain no more. I don't have ios 11 device to check if the store displays the promo for selected iaps, but it should work, hopefully. Thanks!

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

spikenorbert commented 5 years ago

@rafaellop - sorry for resurrecting the dead thread, but did the promoted IAP functionality work in the end?

rafaellop commented 5 years ago

@spikenorbert yes, as I mentioned above the stale bot comment.

spikenorbert commented 5 years ago

@rafaellop - thanks - I saw that the app passed review, but at the time of that comment, you hadn't been able to check whether the promoted IAP actually appeared on the store yet - that's what I was wondering about.

rafaellop commented 5 years ago

@spikenorbert Yes, it appears in the appstore app on ios 11+. The fix worked properly.

spikenorbert commented 5 years ago

@rafaellop - cool, thanks for the update!