react-native-purchases
react-native-purchases copied to clipboard
getCurrentOfferingForPlacement not working for the first app use.
- [x] I have updated Purchases SDK to the latest version
- [x] I have read the Contribution Guidelines
- [x] I have searched the Community
- [x] I have read docs.revenuecat.com
- [x] I have searched for existing Github issues
Describe the bug
Faced a "funny" bug. When calling getCurrentOfferingForPlacement it didn't work and returned null on Android although I had everything set up (it worked well on iOS).
It turns out, when I debugged, I called one time getOfferings to communicate to my RevenueCat Android app platform. And suddenly it unlocked all my calls to getCurrentOfferingForPlacement. getCurrentOfferingForPlacement started to proprely return values although I didn't change anything. I could then get rid of getOfferings call without any issue
I am not sure if this happens only on Android, I suspect this may also happen with iOS apps.
TLDR: before calling getCurrentOfferingForPlacement it seems you need to be sure that getOfferings has been called one time during the entire lifecycle of your RevenueCat app.
- Environment
- Platform: Android
- SDK version: 8.6.1
- OS version: Android 14
- Xcode/Android Studio version: Android Studio Ladybug Feature Drop | 2024.2.2
- React Native version: 0.76.7
- SDK installation (CocoaPods + version or manual): COCOAPODS: 1.16.2
- How widespread is the issue. Percentage of devices affected.
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hi, thank you for reporting this. The team is looking into this and I will update here with what we find.
Hi @PierreCapo, I'm very sorry about the delay on this reply. We've been auditing our ticketing system and found that your ticket was never resolved. Are you still running into this issue? If so we can resume looking into this.
Hello @HaleyRevcat I haven't checked again, but I am setting up a new project on Android in a few weeks, so I will let you know if I can see the bug occurring again.