iaphub / react-native-iaphub

The easiest way to implement IAP (In-app purchase) in your React Native app.
https://www.iaphub.com/
MIT License
319 stars 21 forks source link

Auto-renewable subscription doesn't renew on Sandbox #55

Closed enrickdl closed 3 years ago

enrickdl commented 3 years ago

Hey guys, how's everything?

I'm setting up IAPHUB on my React Native App and using Webhooks on a node backend. Yesterday, while testing, I noticed that all my purchases weren't being renewed, even though all my subscriptions are set as Auto-renewable subscription. When I click on the webhook to see more information, I've noticed this field on the request body:

"subscriptionCancelReason":"customer_cancelled"

The funny thing is that I haven't canceled the subscription at any anytime and throughout the last week, I wasn't getting this kind of behavior, all my subscriptions were auto-renewing. Is this normal when I'm using the Sandbox environment? Or it can be something on my app or our backend? Again, this just started happening yesterday.

Thanks in advance!

iaphub commented 3 years ago

Hi @enrickdl,

It is normal, itunes renew a subscription in sandbox up to 5 times and cancels the subscription randomly for testing purposes. If you try buying a subscription later again you'll probably have renewals.

enrickdl commented 3 years ago

Hi @iaphub, that wasn't the case. The problem was: I'm buying an auto-renewable subscription for the first time and it expires with 5 minutes, without even trying to renew as it happens with sandbox.

However, I find out that if I'm not logged in to App Store, all my purchases will be expired, so I believe that this was the problem, since I had to switch Apple Id accounts and the App Store doesn't automatically log in with the new account.

enrickdl commented 3 years ago

Hey @iaphub, Unfortunately, I was wrong and the problem still persists. I've tried with all my accounts logged (Apple Id and App Store) and the same error happened.

The first try that I had today worked (My comment 3 hours ago), but all the other ones didn't. I've tried with different users and the same problem persists.

I'll attach a photo of all of my requests today:

Screen Shot 2021-01-08 at 11 32 57


Another problem is that I've got 4 different products (2 with a free trial and 2 without), and when I create a listing, the subscriptionPeriodType shows accordingly. But after the first requests, all of the products show subscriptionPeriodType: normal even though 2 of them should show trial. Should I open a new issue for this?

iaphub commented 3 years ago

We do not know why itunes isn't renewing your subscriptions in sandbox anymore, can you try with a new sandbox account? Also please contact support@iaphub.com with the id of your app, we'll take a look at your app.