3.0.0-rc.5
0.59.2
iOS
When upgrade subscriptions, it's should return new transactionReceipt
return error code:0 and debugMessage: "cannot connect to itune store" (look like this message is same for all error type)
Real device
The first time i try subscription for plan 3 Months. Everything work perfect!
But after that, i try to upgrade to plan 6 months, it's still show alert that said purchase was successfully.
But in the purchaseErrorListener function return an error with code = 0, and debugMessage: "cannot connect to iTunes store" (look like this message is same for all error type).. And i also CANNOT get any new transactionReceipt in purchaseUpdatedListener function.
I don't have experience with native swift code, so hard to understand what happen in this module. :(
Do we have any solution to fix this? Please help me :(
so i think the only solution at this time is check if user already bought a subscription before, the UI app shouldn't let user update to another subscriptions plan.
Still wait some better way to fix this.
@tybq93 Could you provide some ideation for the implementation? Maybe I can go over it after that.
I'm running into this problem too. Related to https://github.com/dooboolab/react-native-iap/issues/274 and https://github.com/dooboolab/react-native-iap/issues/306#issuecomment-449582904
I have 2 subscriptions in the same subscription group (so you can downgrade/upgrade). One for 4.99 and one for 9.99.
When I upgrade (requestSubscription('9.99')) from no subscription to a 9.99 subscription, all fine. When I'm on the 9.99 subscription and want to "downgrade" (`requestSubscription('4.99') to the 4.99 subscription, it fails.
The topic start has a problem during upgrade, but i might think these problems are related.
After failure, when I press the "downgrade" button (requestSubscription('4.99')) again for the 4.99 subscription, it gives an alert saying i'm subscribed to that one. But I never received a receipt through purchaseUpdatedListener, so could not verify it's validity. The purchase is also not available in getAvailablePurchases, so I can't verify if it's purchased. I'm stuck.
Some extra info:
requestSubscription('4.99') with the above scenario with "Cannot connect to iTunes Store". (connection/internet is available)purchaseUpdatedListener, which is what you expect to happen?Below some screenshots:
Right after pressing Upgrade and calling requestSubscription('4.99'):
https://user-images.githubusercontent.com/5155373/60538753-826ea080-9d0b-11e9-83f5-b67b15674ade.jpg
Next step...
https://user-images.githubusercontent.com/5155373/60538762-826ea080-9d0b-11e9-9b77-3db7657be2a9.jpg
Next step, confirming, looks good...
https://user-images.githubusercontent.com/5155373/60538759-826ea080-9d0b-11e9-8557-e0f4bcb9371f.jpg
Next step, "All set"? But nothing in purchaseUpdatedListener()
https://user-images.githubusercontent.com/5155373/60538755-826ea080-9d0b-11e9-9e40-aa93b9f5ff33.jpg
Next step, requestSubscription('4.99') fails
https://user-images.githubusercontent.com/5155373/60538754-826ea080-9d0b-11e9-993e-482e1ac2908b.jpg
I've been doing some Google searching, found this from an Apple employee:
The problem which you have described leads me to ask - In the App Store Connect records for your application - what is the order of the subscription items within the subscription group. Is the 1 Week subscription plan an upgrade to the 3 month subscription? or vice versa? The ordering of the subscription items listed in the application records determines whether one subscription item is an upgrade or a downgrade to another item. Duration of subscription is not used to determine whether one subscription item is an upgrade or a downgrade to another subscription item.
@tybq93 have you checked the order of your subscription plans in iTunes Connect? 6 months needs to be on top of the 3 months, since it's an upgrade according to you. You can drag and drop to re-order in iTunes connect in your subscription group
Because of this, I think your current situation suggests a "downgrade" and why I think the problem you describe is related to my "downgrade" problem.
That Apple topic might also explain why I see the error on downgrade:
If the 3 month plan is a downgrade to the 1 week plan, then when the 1 week plan is currently active for a subscriber, then if the user attempts to "downgrade" to the 3 month plan, the iTunes Store should indicate to the user that the new plan will go into effect at the end of the current subscription. In this case, the user account has not been charged. The essence is that the transaction was not a success, but instead a failure. As there is no "user to be charged later" state, the App Store returns the failed transaction result.
I think "downgrading" / "crossgrading" is not testable on the Sandbox environment, but I can't confirm it just yet. Stackoverflow comments suggest it just does not work in Sandbox. But the error is really confusing and wonder if that's still there in Production. Guess the only way to find out is to put it in Production...
@jvandenaardweg Hey man, thanks for your technical analysis. I am also getting this problem with the sandbox environment. Not sure if it will fix in the production environment or not. Did you have some luck finding out what is causing this problem and how to solve this?
Also getting this issue in https://github.com/dooboolab/react-native-iap/issues/803 any more insight into this? Any further pointers would be very much appreciated.
I have similar experience when implementing in-app purchase subscription in iOS native code. And I would suggest:
The iOS in-app purchase sandbox environment is really confusing and even buggy. Upgrading does work, and it should get receipt immediately. Downgrading only happens at next billing period, so does your downgrading receipt. But sandbox environment gives you "maximum 5 automatic renewals", which you cannot (easily) expect how many renewals will occur. What's more, you cannot cancel subscription in sandbox environment, because App Store subscription management page doesn't work in sandbox environment. These have made subscription testing really painful. Read more on my blog post Unpredictable Sandbox Environment for IAP Auto-renewable Subscriptions if you're interested.
I got "Cannot connect to iTunes Store" error message at quite a few scenarios (ex. tap some subscription plan), which was confusing for the users, and it does not help error handling at all. That was the reason I got rid of in-app page for upgrading/downgrading subscription on production app.
The iOS subscription implementation isn't complete without having your own server for validating receipt and receiving Server-to-Server Notifications. Because iOS users can switch or cancel subscription plans at any time or on any device, without entering the app (i.e. through App Store subscription management page). And you'd better not rely on getAvailablePurchases at every iOS app launch to check it, because iOS would prompt sign-in dialogue, which results in bad user experience (See: https://github.com/dooboolab/react-native-iap/issues/747).
Abstraction does leak. Deal with it.
I will get back to this in the next month or two hopefully and will let you know thE outcome @hyochan
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Most helpful comment
I'm running into this problem too. Related to https://github.com/dooboolab/react-native-iap/issues/274 and https://github.com/dooboolab/react-native-iap/issues/306#issuecomment-449582904
I have 2 subscriptions in the same subscription group (so you can downgrade/upgrade). One for 4.99 and one for 9.99.
When I upgrade (
requestSubscription('9.99')) from no subscription to a 9.99 subscription, all fine. When I'm on the 9.99 subscription and want to "downgrade" (`requestSubscription('4.99') to the 4.99 subscription, it fails.The topic start has a problem during upgrade, but i might think these problems are related.
After failure, when I press the "downgrade" button (
requestSubscription('4.99')) again for the 4.99 subscription, it gives an alert saying i'm subscribed to that one. But I never received a receipt throughpurchaseUpdatedListener, so could not verify it's validity. The purchase is also not available ingetAvailablePurchases, so I can't verify if it's purchased. I'm stuck.Some extra info:
requestSubscription('4.99')with the above scenario with "Cannot connect to iTunes Store". (connection/internet is available)purchaseUpdatedListener, which is what you expect to happen?Below some screenshots:
Right after pressing Upgrade and calling
requestSubscription('4.99'):https://user-images.githubusercontent.com/5155373/60538753-826ea080-9d0b-11e9-83f5-b67b15674ade.jpg
Next step...
https://user-images.githubusercontent.com/5155373/60538762-826ea080-9d0b-11e9-9b77-3db7657be2a9.jpg
Next step, confirming, looks good...
https://user-images.githubusercontent.com/5155373/60538759-826ea080-9d0b-11e9-8557-e0f4bcb9371f.jpg
Next step, "All set"? But nothing in
purchaseUpdatedListener()https://user-images.githubusercontent.com/5155373/60538755-826ea080-9d0b-11e9-9e40-aa93b9f5ff33.jpg
Next step,
requestSubscription('4.99')failshttps://user-images.githubusercontent.com/5155373/60538754-826ea080-9d0b-11e9-993e-482e1ac2908b.jpg