daniele-pecora / nativescript-in-app-purchase

NativeScript plugin to handle in app purchases and subscriptions on Android and iOS.
Apache License 2.0
13 stars 10 forks source link

Add ios get receipts #3

Closed rob4226 closed 3 years ago

rob4226 commented 3 years ago

I have added two functions, getStoreReceipt(), and refreshStoreReceipt(), for iOS with regard to getting the current users AppStore receipt. This helps especially when dealing with in-app purchase subscriptions.

getStoreReceipt()
Returns the application's Base64 encoded store receipt for the currently logged in iOS App Store user. This is necessary for checking subscription status under iOS when hitting the "verifyReceipt" in order to send a receipt to the App Store for verification.
For Android, this function always returns undefined.

refreshStoreReceipt() On iOS, requests to refresh the store receipt, which represents the user's transactions with your app. It refreshes the store receipt for the currently logged in AppStore user. Use this API to request a new receipt if the receipt is invalid or missing. On iOS, it returns a completed promise once the refresh is complete.
On Android, the promise just always completes.

NazimMertBilgi commented 3 years ago

@Rob4226 #4 can you deal with that too? Thank you.

rob4226 commented 3 years ago

@Rob4226 #4 can you deal with that too? Thank you.

Yes, I actually have updated the Google Billing API to v4 I just didn't get a chance to make a PR yet.

Edit: Nevermind I see you already updated to v4.