react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

Sandbox account infinite loop

Open KevinColemanInc opened this issue 7 years ago • 7 comments

I am experiencing this issue on iOS. Any suggestions on how to resolve this with the given RN-purchases js code? I am not very experienced in swift.

As such, you need to call finishTransaction: on the associated transaction to end the loop to resolve your issue. See TN2387 In-App Purchase Best Practices > Add a transaction queue observer at application launch and Finish the transaction for more information on how to prevent this issue.

I am not seeing how to call finishTransaction with the given react native purchases API.

KevinColemanInc avatar Feb 21 '19 05:02 KevinColemanInc

We will call finish transaction for you automatically.

Are you calling restoreTransactions somewhere? This can trigger a receipt refresh and pop the login modal in sandbox.

jeiting avatar Feb 21 '19 18:02 jeiting

I do have restoreTransactions enabled. Could this happen if I close the app when its asking for my password before restoreTransactions finishes?

KevinColemanInc avatar Feb 24 '19 08:02 KevinColemanInc

restoreTransactions will trigger a receipt refresh if a receipt isn't on the device. This is usually the case if an in-app purchase hasn't yet been made.

I suggest making sure you are limiting your number of restoreTransactions calls so it's not being called repeatedly.

jeiting avatar Feb 25 '19 16:02 jeiting

Sorry, I thought I responded to this.

I already hide the button immediately after the restore was pressed to prevent double tapping. Maybe I closed the app after clicking on a purchase or restore and then opened it up again?

If I do a hard reset and then restore from backup of my phone, the issue goes away until I run my app for the first time. Once I run the app, (which I guess triggers RevenueCat Setup), I start experiencing this infinite loop again at random times (like when phone is locked, any app is running, etc.).

KevinColemanInc avatar Mar 02 '19 02:03 KevinColemanInc

If restoreTransactions is only tied to a button you should be ok.

Do you know how your Sandbox account is setup? Do you have one that you have added via the App Store settings? (inside the settings app)

jeiting avatar Mar 02 '19 20:03 jeiting

When the issue first started happening, I didn't remember the password to the test account causing the issue, so I went to the App Store settings and logged out of the given Sandbox account.

The message continued to show up, except it would say "Please sign into ." with no account email at the end.

I tried deleting the sandbox account in the App Store as well, but it still prompts me for a password for this blank / nonexistent account.

Currently, I have a valid sandbox account configured in the Settings app and I am able to make and restore purchases with that account, but it still asks me to enter my password to the blank account.

I also messaged Apple's dev support and they haven't gotten back to me in 10 days :-/

KevinColemanInc avatar Mar 03 '19 03:03 KevinColemanInc

Ah, you've probably got "purchases" made with both accounts. This is a bug I've noticed with multiple sandbox accounts on the same device, if you stop using one that has had recurring subscriptions, it will just freak out on you forever.

The only solution I've found is a factory reset. Sorry.

The good news is it only happens when you test your app, the bad news is it happens when you test your app.

I'm going to close this issue since I don't think it's RC related but let us know if you need help getting the situation resolved.

jeiting avatar Mar 04 '19 15:03 jeiting