Question

Purchases.purchasePackage() doesn't return



Show first post

42 replies

Badge +2

Yes same warnings with React Native on Xcode debug log, building in release mode.

using react-native-purchases : 5.14.0 (updating from 4.4.1 who has no warning)

 

2023-05-05 11:20:45.154377+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.154609+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.154706+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.154791+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.154908+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.155013+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.155075+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.155140+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.

 

I too am getting this on my flutter project

Badge +3

Yes same warnings with React Native on Xcode debug log, building in release mode.

using react-native-purchases : 5.14.0 (updating from 4.4.1 who has no warning)

 

2023-05-05 11:20:45.154377+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.154609+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.154706+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.154791+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.154908+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.155013+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.155075+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
2023-05-05 11:20:45.155140+0200 Cookomix[1507:635477] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.

 

Userlevel 1
Badge +4

Any update on this? I’m getting this error with the latest SDK with React Native

Userlevel 1
Badge +5

Hi @Chaitanya 

I tested with a sandbox account. 
Also tried with a real apple account and it was good.

Badge +1

 

Hi Cesar, I haven’t tested on simulator as you said (using storekit config file) yet. Other than that the function does return on real iphones after setting Appstore shared secret.

 

Hi @Thanh, when you tried this on physical device, are you using sandbox tester account or the real apple account ?

Userlevel 1
Badge +5

Hi Cesar, I haven’t tested on simulator as you said (using storekit config file) yet. Other than that the function does return on real iphones after setting Appstore shared secret.

Userlevel 3
Badge +3

@Thanh Did you figure this out? We couldn’t reproduce purchasePackage not returning. We have identified an issue with purchaseProduct, but that seems unrelated

Userlevel 3
Badge +3

but it still hangs on the iOS simulator.

 

That’s probably because iOS simulators require a special configuration using StoreKit config files. You can read more about that in this article in our docs https://docs.revenuecat.com/docs/apple-app-store#ios-14-only-testing-on-the-simulator

Do you mind giving that a try and report back?

The fact that purchasePackage doesn’t return is indeed a weird one, because I would expect it would throw an error indicating there’s a problem with your configuration in RevenueCat. We’ll look into that

Userlevel 1
Badge +5

@Cesar Thank you for the update. I’m eager to try out the new release ^^

Are you also handling errors? Do you see any PlaformException at all?

 

Yes I have try & catch block to handle the exception but there’s no exception thrown at all because the function purchasePackage doesn’t return.

Here’s my code:

                              try {
final CustomerInfo customerInfo = await Purchases.purchasePackage(packages![selectedPackageIndex!]);
final isPremium = customerInfo.entitlements.all[REVENUE_CAT_DEFAULT_ENTITLEMENT]?.isActive ?? false;
if (isPremium) {
// Display flashbar and go back
}
} on PlatformException catch (e) {
final errorCode = PurchasesErrorHelper.getErrorCode(e);
if (errorCode != PurchasesErrorCode.purchaseCancelledError) {
print(e);
}
await showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text("Error"),
content: SingleChildScrollView(
child: ListBody(
children: [
Text(e.message.toString()),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('Ok'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
),
);
}
setState(() {
isLoading = false;
});
}

 

Userlevel 1
Badge +5

My mistake, I didn’t add the Appstore shared secret to Revenuecat. After I did, the function doesn’t hang on my real iPhone, but it still hangs on the iOS simulator.

Userlevel 3
Badge +3

Hi @Thanh !

We are trying to reproduce the issue. As @Andy suggested in the GitHub issue, we're currently preparing release 4.2.0, which will get rid of the warnings you see on the console and might also fix the issues, since it uses StoreKit 2 APIs under the hood, and they seem to be more reliable.

Are you also handling errors? Do you see any PlaformException at all?

 

Userlevel 1
Badge +5

Hi @Cesar do you need more information to reproduce this?

Badge +3

I am having this same issue. 

Userlevel 1
Badge +5

This looks related to my issue: https://github.com/RevenueCat/purchases-flutter/issues/431

Badge +1

Getting same error on IOS Device at the same place as the poster (also not using android):

[Purchases] - WARN: 🍎‼️ There is a problem with the SKPaymentTransaction missing a transaction date - this is an issue with the App Store. Unix Epoch will be used instead.

Transactions in the backend and in webhooks are unaffected and will have the correct timestamps. This is a bug in StoreKit 1. To prevent running into this issue on devices running iOS 15+, watchOS 8+, macOS 12+, and tvOS 15+, you can set `usesStoreKit2IfAvailable` to true when calling `configure`.

 

I’m using flutter and had the following code:

await Purchases.setup("blahblahblah",    appUserId: LoginUser.userUid);

which was showing as deprecated.

So I updated to the new format found on the revenuecat website:

 await Purchases.configure(     PurchasesConfiguration("blahblahblah")       ..appUserID = LoginUser.userUid

and got the above error. 

Reverted back to the deprecated code and its working ok.

Userlevel 1
Badge +5

Hi @Cesar, I’m experiencing this on iOS only. I haven’t been able to test this on Android yet.

I tried on both physical iPhone and simulator, both stuck after tapping the package (which triggers the purchase function).

Userlevel 3
Badge +3

Thanks for opening this question with more details. One quick question. Does this happen to you only on iOS? Have you tried on an Android device?

Are you running on a physical device or a simulator?

Thanks!

Reply