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

RNIap.requestSubscription({}) returns cancelled subscription in result for iOS #2745

Open
gosis opened this issue May 21, 2024 · 2 comments
Open

Comments

@gosis
Copy link

gosis commented May 21, 2024

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

We recently put an iOS app with subscriptions into App store.

We have received reports that users are unable to resubscribe after cancelling their subscription.
After looking into the issue we discovered that RNIap.requestSubscription({}) keeps returning previously cancelled subscription and no payment view is presented.
While transactionId, transactionReceipt are new with every subscription they have previous subscription expiration_time and pending_renewal_info

Meaning when calling RNIap.requestSubscription({}) no payment screen is presented and a cancelled subscription is returned immediately. After validating the new transactionReceipt we see..
'pending_renewal_info': [{'expiration_intent': '1', - which means the subscription is cancelled.

And the decoded transactionReceipt has receipt_creation_date of today, but the expires_date in the past

'expires_date': '2024-04-10 18:30:59 Etc/GMT'
'receipt_creation_date': '2024-05-21 08:08:09

Expected Behavior

RNIap.requestSubscription({}) creates a new subscription instead of returning canceled subscription without prompting for payment.

Environment:

  • react-native-iap:
  • Platforms (iOS):

To Reproduce
Steps to reproduce the behavior:

  1. Buy a subscription in iOS production or sandbox
  2. Cancel subscription (production only) or wait until its expired(sandbox)
  3. Buy the same subscription again
  4. No payment screen is presented and RNIap.requestSubscription({}) returns with result
  5. Validate new subscription result.purchase.transactionReceipt against apple servers
  6. See expires_date is in the past

@salsowelim
Copy link

We have the same issue as well

@gosis
Copy link
Author

gosis commented Jun 25, 2024

We have added a following workaround for production only

If RNIap.requestSubscription({}) returns an expired subscription, we display an alert to the user saying that he already has a subscription and he has to go to phone settings -> my subscriptions to renew it. There is a renew button there.

After the sub is renewed its expires_date is updated

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

2 participants