-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
getSubscriptions returns an empty array on Android #2720
Comments
hhhhhhh, I have the same problem. hhhh, God maybe help me. |
I got it working in the end!!! After so many attempts and a little bit of luck as well i guess.
There were so many parameters to take into account! I'm going to try to list them here:
1. Use the provided example
Use the "subscriptions" screen from the iapExample app (https://github.com/dooboolab-community/react-native-iap/blob/main/IapExample/src/screens/Subscriptions.tsx). Leave it as is, except specify your own product_id in the subscriptions skus section.
2. App signing:
I think I finally understood how the library works. You first need to build your app (I built with expo) then download the .aab file and on your play console account, in the internal testing section, you can upload your .aab build. Once uploaded, go to the "downloads" tab of the release you just created, you can then download the "signed apk". This is the version that you install on your device. I think this signature is what links the app to the play store account.
3. Physical device or emulator:
I had it working once in a simulator but then I couldn't get it working (empty subscriptions again) so I had to install the Signed APK on a physical device instead. So maybe try that.
4. Propagation time on google servers:
When you create subscriptions and pricing plans, they won't be visible straight away from the subscriptions screen. In fact the first time I saw something being displayed was the day after the day I had coded it (that's why I say it was a bit of luck). So count at least a few hours before hoping to see your changes reflected on the device.
5. Publish your app:
Even if it is in internal testing, you should publish your app. I'm not sure but I think it is necessary to have the subscriptions available through the API.
6. License testing:
Add the google account email that is linked to the device to the license testing email list (https://blog.logrocket.com/implement-react-native-in-app-purchases-android-apps/#add-license-testers). Not sure this is mandatory either but I did it regardless. Also this will allow you to be in test mode and not be charged with your bank card.
That's all I can recall for now. But yeah, google ecosystem is crazy confusing and there is not much documentation about this library either.
Hope this helps!
|
Thank you, I will try those steps. |
Luckily, I have solved this problem finally. |
Post your solution here as it might help others :)
Le ven. 3 mai 2024 à 06:45, Rick ***@***.***> a écrit :
… Luckily, I have solved this problem finally.
—
Reply to this email directly, view it on GitHub
<#2720 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHII5EVRX6JS7TFEFPFUD3ZAMI5LAVCNFSM6AAAAABFXWIX46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJSGEYTGOBVG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment:
I managed to get the subscriptions list on iOS but now I'm trying to do so on android and the
getSubscriptions
method is not returning anything.How does the library even work ?
In fact I'm a bit lost about how it even works. How does react-native-iap know which Google Play project is associated with my mobile app and where to fetch the products and subscriptions from? Unlike other libraries, there is no API key or anything that I had to set in my project.
I have uploaded my .apk (.aab actually) to my play store app, and now the play store project is aware of the bundle ID. Is that how it works ?
Regardless of how it works.. why it doesn't work !!! 😭😭 any help would be much appreciated !!!
The text was updated successfully, but these errors were encountered: