-
-
Notifications
You must be signed in to change notification settings - Fork 537
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
store.when().approved() is triggered each time on app launch #1428
Comments
If you make a purchase but don't This is useful for example if you have promotional codes, so they enter them in Google Play, then enter the app, and they can redeem the product (or you can make the user follow a few steps before calling the About the store.validator = If you don't define a store validator, you can't use the verify function, it just doesn't work. HOWEVER I released my APP on Apple Store, and I'm experiencing the exact same bug as yours. A friend just installed the app, and he is telling me that when he opens the app, it continuously triggers the verify() callback (in my app it also displays a "waiting" popup, so it's unusable). Of course he didn't buy anything either, and I have logs that it happens to every iOS user. Unfortunately, I don't have an iPhone and the emulator doesn't support in-app purchases, so I can't test it properly. I don't know if it's related to this #1269 |
Maybe version 13 is not ready for production yet, @j3k0? But v11.0 uses com.android.billingclient:billing:4.0, which will be deprecated in 2nd August |
v13 is ready and used in production. The "gitbook" default hasn't been updated. We'll fix that. |
So, as I've said, it's normal that at every app launch the About this problem:
I've just tested it with StoreKit. Apparently (I don't know if it's by design) in iOS, you get an "approved" callback the first time you initialize in-app-purchases, with your bundle ID as product id. Just add this code to catch it / prevent it from doing anything, and you will fix your problem:
|
That is normal, the iOS app is bought as you buying everything even it is free at apple. |
Recently we upgraded the plugin from v11.0.0 to the v13.6.0. In app purchases worked fine while we were testing the iOS version in Test Flight. But after the production publish, we found this issue is happening in the production version of our iOS app. In the production app, the In App Purchase is always approving for all the users when the app is starting. So now, the product is enabled for all the iOS users of the new app version including the users who haven't purchased the product. We have paused the phased rollout for now, but around one fourth of the iOS user base has got the update already. I am considering to move back to the old plugin version and do an iOS only release as a temporary solution. In our case, this is happening only in the App Store version of the iOS app, so we didn't know about it before publishing. And also, I noticed, Product.owned always returns false in iOS (even when the users has purchased the product). We are using the plugin with Capacitor 5. |
I encountered the same thing on iOS. Before in v11, when I started the app, the However, there's a difference that I overlooked at first:
v13 code:
v11 filtered all incoming based on the productId, whereas the v13 handler does not filter. Hence, on every app start on iOS, you receive a transaction with the transactionId
Hence, you need to filter in your handler based on existing (real) product ids. But I haven't tried it in production yet. @TheNotorius0 gave a hint, but I didn't understand why this didn't happen before in v11. The filtering seems to be the difference. But I think you don't need to call |
I also noticed that the |
It just means that you "bought" the (free) app. The app itself is considered a transaction. If you install an app from the App Store, you are asked for your password and if you really want to "purchase" the app, even if it's free. For some reason, this transaction shows up all the time. |
@cmaas Thank you very much for the clarification! Makes sense. |
While testing payments on Android, it's scheduled in 5 minutes to cancel a purchase, and during this 5 minutes, I'm getting triggered .approve() callback each time when the app launched.
Why so?
And it's will be triggered each time for production as well?
By the way, callback verified() never triggers:
UPDATES:
Started testing iOS on Testflight.
Really weird behavior, I just installed the app, and after launching it, continuously triggers approve() callback, with no reason. I didn't buy anything yet.
What is happening over there?
The text was updated successfully, but these errors were encountered: