Question

Purchases.purchasePackage() doesn't return



Show first post

32 replies

Badge +2

Hello,

 

I am using purchases_flutter: ^5.5.0.

Testing on iOS real device + Sandbox account. The function doesn't return in my case as well.

Everything seems to work smoothly, the log goes up to "PostReceiptDataOperation: Finished". But I can't seem to get the return value of ```await Purchases.purchasePackage(package);```

 

I checked the config so all keys are correctly set in RevenueCat.

 

Do you guys have any information about that ?

 

 

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.



the deprated setup trick not solving this issue for the latest plugin purchases_flutter: ^5.6.5

still get error logs

StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.

but deprecated usesStoreKit2IfAvailable setter did resolve the issue.

 

final PurchasesConfiguration purchasesConfiguration = PurchasesConfiguration("apikey");
purchasesConfiguration.usesStoreKit2IfAvailable = true;

 

Purchases.purchasePackage() call doesn’t return for me either.

I use the capacitor plugin version 7.0.0.

I tried to place a breakpoint on the API methods. All of these work fine: setLogLevel, configure, getCustomerInfo.

But purchasePackage doesn’t get executed at all. It seems the problem is somewhere in the capacitor plugin.

Badge +4

Purchases.purchasePackage() call doesn’t return for me either.

I use the capacitor plugin version 7.0.0.

I tried to place a breakpoint on the API methods. All of these work fine: setLogLevel, configure, getCustomerInfo.

But purchasePackage doesn’t get executed at all. It seems the problem is somewhere in the capacitor plugin.

Figured out it was reactivity issue in Vue.js, I thought that .toRaw() is reactive object method, but it is vue utility that you need to use on object.

Badge +3

Hi there,

 

I’m using the react native package with Expo and I’ve got the same issue. It appears on Android / iPhone.

If I cancel the payment then the catch function is triggered and I can handle the situation.

 

But if the payment processes, I’ve got the tick from the Apple / Android payment popup. Subscription is created in revenuecat but the function never returns anything.

I’ve a “console.log(“Payment ok”); right after but it’s never executed. Neither any other code.

 

I’ve even tried on a new project with no other library installed, only revenuecat and the issue is here too.

@Cesar  do you have any idea?

 

Thanks!

 

Regards,
Alex

Badge +1

I am experiencing the same issue with Flutter 6.3.0 MagicWeather example; tried to run in XCode, and the same debug messages:
This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.

 

https://github.com/RevenueCat/purchases-flutter/issues/875

 

Badge +1

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

 

This documentation link describes how to configure and use local App Store simulator (instead of actual App Store sandbox); but I need full integration test…

 

Fortunately, it works with real device (when I connect iPhone to Mac, and run it via XCode on real iPhone).

And today is Nov-18-2023, still unresolved, looks like bug from Apple.

I created this issue: https://github.com/RevenueCat/purchases-flutter/issues/875 - indeed it is not just “apple” ;)

For example, Flutter library in_app_purchase: ^3.1.1 doesn’t have such issue.

Reply