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

Couldn't find product error returns from `getPromotionalOffer` function

Open vargajacint opened this issue 2 years ago • 2 comments

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]);
  1. Environment
    1. Platform: IOS
    2. SDK version: 5.0.0-beta.4
    3. OS version:
    4. Xcode/Android Studio version:
    5. React Native version: 0.69.1
    6. SDK installation (CocoaPods + version or manual): CocoaPods
    7. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
  4. 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.

vargajacint avatar Aug 13 '22 19:08 vargajacint

👀 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!

RCGitBot avatar Aug 13 '22 19:08 RCGitBot

Screenshot 2022-08-13 at 21 47 33

Screenshot 2022-08-13 at 21 48 26

Screenshot 2022-08-13 at 21 48 45

vargajacint avatar Aug 13 '22 19:08 vargajacint

@vargajacint Thanks for reporting this! I will try to replicate this today and get back to you 💪

joshdholtz avatar Aug 17 '22 13:08 joshdholtz

@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?

joshdholtz avatar Aug 19 '22 01:08 joshdholtz

Screenshot 2022-08-13 at 21 48 26

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"}}

vargajacint avatar Aug 22 '22 17:08 vargajacint

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

joshauh46 avatar Aug 30 '22 11:08 joshauh46

Same in here. If I turn off the 'usesStoreKit2IfAvailable' property, it's seems like starts to work. Tested on iOS 15.6

vargajacint avatar Aug 30 '22 14:08 vargajacint

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.

KristineTrona avatar Aug 30 '22 14:08 KristineTrona

Thanks for the reports. We are looking into it

vegaro avatar Aug 30 '22 17:08 vegaro

We have identified the issue and we are working on a fix at the moment

vegaro avatar Aug 30 '22 23:08 vegaro

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

vegaro avatar Aug 30 '22 23:08 vegaro

We have released version 5.0.1, which fixes the issue. Please let us know if something else comes up

vegaro avatar Aug 31 '22 05:08 vegaro