j3k0 / cordova-plugin-purchase

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

[iOS] Support Apple's receipt validation? #640

Closed macfam closed 6 years ago

macfam commented 6 years ago

Apple recently updated receipt validation for subscription based in-app purchases. I am curious if this plugin will support their newly updated methods/responses?

https://itunespartner.apple.com/en/apps/news/45333106

jbgomez21 commented 6 years ago

Hi @macfam, Do you have this plugin working for auto-renewable subscriptions?

Please I need help with a working example!

Regards!

Dexus commented 6 years ago

Guys you need to use a validation service, that checks you subscription and retuns ok if it is ok or else an error. Second you need an public api where apple send his subscription notifications that tells you how is the state of the subscription. Please read the Apple Developer docs and try to understand how it works.

This Plugin is only one part that you can use or need to provide IAPs but thats not the only thing you need.

So please do not mix up application requests with server requests.

macfam commented 6 years ago

@Dexus so is it safe to assume that the newly added information will be returned to the store.validator method? That was the base of my question.

@jbgomez21 yes, and I remember using these examples to implement.

Almerick commented 6 years ago

@macfam yes, the new receipt fields are included in the iTunes response object, when validating. It will be present in the "pending_renewal_info" key, which is parallel to the "receipt" and "latest_receipt" keys. These new fields are not reliant on the plugin supporting it, purely based on iTunes including it in the validation response.

macfam commented 6 years ago

@Almerick perfect, thanks for the response.

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.