adaptyteam / AdaptySDK-Flutter

SDK for growing mobile in-app purchases
https://docs.adapty.io/docs/quickstart
MIT License
88 stars 15 forks source link

code: 1004, message: No purchases to restore, detail: null #75

Closed otopba closed 1 year ago

otopba commented 1 year ago

Hey!

I see this error on android in crashlytics when trying to get paywall.

adapty_flutter: ^2.2.4

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: (code: 1004, message: No purchases to restore, detail: null). Error thrown null.
       at Adapty._invokeMethodHandlingErrors(adapty.dart:266)
       at Adapty.getPaywall(adapty.dart:97)
       at OnboardingChatPageCubit._init(onboarding_chat_page_cubit.dart:161)
vladd-g commented 1 year ago

hi @otopba

Though it's technically an error, it actually isn't, it just means that the user has no purchases in the history. Do you send it manually from the callback of restorePurchases()?

otopba commented 1 year ago

@vladd-g

Hi!

In my code, the restorePurchases and getPaywall calls are not logically related. But in some situations they can be called one after the other

And I do not really understand why the getPaywall method returns an error related to restorePurchases

vladd-g commented 1 year ago

@otopba thank you for the report, found the problem, we'll fix it in the next release

otopba commented 1 year ago

@vladd-g Great news. Thank you!

x401om commented 1 year ago

Hey, @otopba! We have fixed this in the latest release!