-
-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to decode base64 result.latest_receipt returned by validateReceiptIos ? #203
Comments
@lc3t35 Thank you for your correction. Could you give us a |
@dooboolab please, I think it's easier for just 1 character changed that you do this ;) Otherwise for the question, do you have some idea ? |
@lc3t35 I've just fixed it and publisehd to |
Thank you @dooboolab , any idea for decoding base64 encoded json receipt ? |
@lc3t35 Haven't had idea yet. I've just use this to verify that the purchase is not malformed. Could you share if you find any news? |
@dooboolab I think there is a problem with the receipt I get, I've tried with another receipt such this one shown here j3k0/cordova-plugin-purchase#215 which decodes well.
|
It seems that I can get renewal.auto_renew_status ("0" or "1") from
Is this enough to know if the user has cancelled his subscription, in this case renewal.auto_renew_status is "0" (i.e. not automatically renewable) ? |
@lc3t35 I was trying to copy the base64 from console while I was debugging my app and trying to make the call to Apple end-point, but it looks like the chrome was truncating the receipt, since I was always getting "invalid receipt" from Apple server. After I sent the base64 receipt data to my local server and made the call to apple, I finally decoded the receipt. |
Related #237 |
you can use this lib https://github.com/Wizcorp/node-iap |
After calling RNIap.validateReceiptIos I see the object with these keys: |
Version of react-native-iap
1.2.1
Platforms you faced the error (IOS or Android or both?)
iOS
I was digging into validateReceiptIos to get more information on subscriptions status, I did this
result.latest_receipt is a base64 encoded json, does someone know the best way to convert it to readable json ?
Ref links :
https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html
https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1
I've noticed an error in isTest param, if isTest is true, it should run as sandbox
should be
The text was updated successfully, but these errors were encountered: