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

[IOS] verifyReceipt is deprecated #1481

Closed acn-masatadakurihara closed 6 months ago

acn-masatadakurihara commented 7 months ago

The receipt validation (verifyReceipt) API for StoreKit 1.0 is now deprecated. This leads me to believe that Apple intends to discontinue support for StoreKit 1.0 in the next major iOS upgrade, but do you have any plans to update to StoreKit 2.0?

https://developer.apple.com/documentation/appstorereceipts/verifyreceipt

Deprecated The verifyReceipt endpoint is deprecated. To validate receipts on your server, follow the steps in Validating receipts on the device on your server. To validate in-app purchases on your server without using receipts, call the App Store Server API to get Apple-signed transaction and subscription information for your customers, or verify the AppTransaction and Transaction signed data that your app obtains. You can also get the same signed transaction and subscription information from the App Store Server Notifications V2 endpoint.

j3k0 commented 7 months ago

Yes I looked into it, StoreKit 2.0 is only available with Swift. However at that time (about 6 months ago) cordova's support for Swift wasn't good (requiring manual changes to source files in the XCode project).

Hopefully when StoreKit 2 becomes a requirement, that will have improved.

tolutronics commented 6 months ago

Is that why i get this error while trying to verify receipt? The data in the receipt-data property was malformed or the service experienced a temporary issue. { "status": 21002 }

acn-masatadakurihara commented 6 months ago

https://developer.apple.com/documentation/appstorereceipts/status It appears to be irrelevant.

At any rate, now that I understand the stance of this plugin, I'll close it for now.

acn-masatadakurihara commented 6 months ago

As I recall, if you are getting 21002 on SANDBOX, it is most likely that the infrastructure is simply not in good shape on Apple's end. I have encountered the same event in the past.

tolutronics commented 6 months ago

So, why are people not complaining yet..Gosh

What do you think i can do, a workaround or something?

acn-masatadakurihara commented 6 months ago

Dependence on any platform demands that much patience. All we can do is wait for the storm to pass. Of course, there is always the possibility that the receipt-data is just wrong, so don't forget to look out for yourself.