react-native-purchases
react-native-purchases copied to clipboard
Couldn't find product error returns from `getPromotionalOffer` function
- [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
I have a subscription that has offers. When I get the subscription with getProducts
function it returns with discounts
field that contains my promotionalOffer. After that I call the getPromotionalOffer
function with the previous function returned product and discount!
Something like this:
const resp = await Purchases.getProducts('full_access', PURCHASE_TYPE.SUBS);
const fullAccess = resp.find((x) => x.identifier === 'full_access')
const offer = await Purchases.getPromotionalOffer(fullAccess, fullAccess.discounts[0]);
- Environment
- Platform: IOS
- SDK version: 5.0.0-beta.4
- OS version:
- Xcode/Android Studio version:
- React Native version: 0.69.1
- SDK installation (CocoaPods + version or manual): CocoaPods
- How widespread is the issue. Percentage of devices affected.
- Debug logs that reproduce the issue
- Steps to reproduce, with a description of expected vs. actual behavior
- Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Additional context Add any other context about the problem here.
👀 SDKONCALL-96 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
@vargajacint Thanks for reporting this! I will try to replicate this today and get back to you 💪
@vargajacint I followed the same code that you got and ended up getting an error but I think maybe a different one 🤔
2022-08-18 20:18:42.602332-0500 PurchaseTester[89206:4877516] [Purchases] - ERROR: 🍎‼️ The User is ineligible for that action. [:]
2022-08-18 20:18:42.616517-0500 PurchaseTester[89206:4879317] [javascript] 'error', [Error: [:]]
Do you have any console logs (probably best if logs are from Xcode) that you could send me?
this is the discount
variable value: [{"cycles": 1, "identifier": "promotedfullaccess", "period": "P1Y", "periodNumberOfUnits": 1, "periodUnit": "YEAR", "price": 48.989999999999995, "priceString": "$48.99"}]
this is the product.fullAccess
value: {"currencyCode": "USD", "description": "Teljes hozzáférés minden kurzushoz.", "discounts": [[Object]], "identifier": "full_access", "introPrice": null, "price": 98.99, "priceString": "$98.99", "productCategory": "SUBSCRIPTION", "productType": "AUTO_RENEWABLE_SUBSCRIPTION", "title": "Korlátlan hozzáférés"}}
Hi, I'm facing the same error on my build with v5, v4 worked fine. Bug only occurs on iOS 15 seems to be related to StoreKit 2 I have attached an iDevice syslog full-debug-log.txt
Same in here. If I turn off the 'usesStoreKit2IfAvailable' property, it's seems like starts to work. Tested on iOS 15.6
Hey, after upgrading to v.5.0.0
I am experiencing the same error as above when calling Purchases.purchaseProduct()
In the logs I see the following:
2022-08-30 16:30:13.932667+0200 MY_TEST_APP[11386:1015907] [Purchases] - DEBUG: ℹ️ Skipping products request because products were already cached. products: ["test.yearly"]
2022-08-30 16:30:13.932722+0200 MY_TEST_APP[11386:1015907] [Purchases] - DEBUG: ℹ️ Store products request finished
2022-08-30 16:30:13.952863+0200 MY_TEST_APP[11386:1014353] [javascript] [Error: Couldn't find product.]
Setting the usesStoreKit2IfAvailable
property to false
fixes the issue.
Thanks for the reports. We are looking into it
We have identified the issue and we are working on a fix at the moment
For reference, this community post is related https://community.revenuecat.com/general-questions-7/flutter-ios-platform-exception-couldn-t-find-product-cannot-be-resolved-1985?postid=6310#post6310
We have released version 5.0.1, which fixes the issue. Please let us know if something else comes up