Skip to content
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

Validate receipt on app startup on V13 #1509

Closed
veronicatc opened this issue Dec 7, 2023 · 8 comments
Closed

Validate receipt on app startup on V13 #1509

veronicatc opened this issue Dec 7, 2023 · 8 comments

Comments

@veronicatc
Copy link

The app I am working on uses auto renewable subscriptions.

On version 11, when I called store.refresh() at initialization, the iOS receipt got automatically validated.

I want to have the same behavior with version 13, but that is not happenning when I call store.initialize(). How can I have the app get the iOS receipt and validate it on startup, after initialize ?

Please help, thanks!

@flyingbarista
Copy link

I am also having this problem, can anyone help this has brought my app to a standstill. All worked perfectly before upgrading. Please help?

@flyingbarista
Copy link

I have made some progress with the following:

CdvPurchase.store.when()
.approved(transaction => {transaction.verify(); console.log("receipt.verify");
document.getElementById('billing_info').innerHTML ="validating purchases" })
.verified(receipt => {receipt.finish(); refreshUI(); console.log("receipt.finish")})

refreshing the UI in the .verified event seems to do the trick

@MarcelSchuermann
Copy link

MarcelSchuermann commented Jan 13, 2024

I think this is related to #1363 - I have the same problem (after reopening the app on iOS, the subscription is not found anymore).

@j3k0
Copy link
Owner

j3k0 commented Feb 8, 2024

You need to tell the plugin that you need the application receipt.

store.initialize([
  {
    platform: Platform.APPLE_APPSTORE,
    options: {
      needAppReceipt: true,
    }
  }
])

@j3k0 j3k0 closed this as completed Feb 8, 2024
@veronicatc
Copy link
Author

You need to tell the plugin that you need the application receipt.

store.initialize([
  {
    platform: Platform.APPLE_APPSTORE,
    options: {
      needAppReceipt: true,
    }
  }
])

I am starting the plugin this way, but store.when().verified is not getting called. I added console.log in there which never shows, and when I call findInVerifiedReceipts, it doesn't find the product.

I see it calls approved for the transaction for the app itself (transaction with id appstore.application) but for no other
transaction. I just purchased a renewable subscription with a Sandbox user, so there is a transaction...

I also updated to the latest version of the plugin, but the issue persists.

I have been checking for hours and don't find the cause. Thanks for any help.

@kreso22
Copy link

kreso22 commented Sep 25, 2024

Any luck with this?

@j3k0
Copy link
Owner

j3k0 commented Sep 26, 2024

If you are running a custom validator, make sure its response complies with the one expected by the plugin (cf API documentation)

@kreso22
Copy link

kreso22 commented Sep 26, 2024

If you are running a custom validator, make sure its response complies with the one expected by the plugin (cf API documentation)

Thank you for your time!

I am not using a validator.

I created a new issue here (with code): #1606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants