Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The await for CustomerInfo customerInfo = await Purchases.getCustomerInfo(); never completed. #768

Closed
7 tasks done
pratikbaid3 opened this issue Jul 21, 2023 · 5 comments
Closed
7 tasks done
Labels
bug Something isn't working

Comments

@pratikbaid3
Copy link

pratikbaid3 commented Jul 21, 2023

‼️ Required data ‼️

Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!

Environment

  • [ X] Output of flutter doctor
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E772610a darwin-arm64,
    locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version
    30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.80.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
  • [X ] Version of purchases-flutter 5.3.0
  • [ X] Testing device version e.g.: iOS 15.5, Android API 30, etc. ```iPhone XR (iOS 14)
  • [X ] How often the issue occurs- every one of your customers is impacted? Only in dev? : App is currently in dev
  • 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.)

Describe the bug

The await for CustomerInfo customerInfo = await Purchases.getCustomerInfo(); never completed.

My SDK initialisation looks like this

  static configureSDK() async {
    if (Platform.isIOS || Platform.isMacOS) {
      StoreConfig(
        store: Store.appStore,
        apiKey: Constants.appleApiKey,
      );
    }
    await Purchases.setLogLevel(LogLevel.debug);

    PurchasesConfiguration configuration;
    if (StoreConfig.isForAmazonAppstore()) {
      configuration = AmazonConfiguration(StoreConfig.instance.apiKey)
        ..appUserID = null
        ..observerMode = false;
    } else {
      configuration = PurchasesConfiguration(StoreConfig.instance.apiKey)
        ..appUserID = null
        ..observerMode = false;
    }
    await Purchases.configure(configuration);
  }

On restarting the app, the subscription becomes active. But the idea is to allow users to subscribe and not have to restart.

Additional context

Add any other context about the problem here.

@pratikbaid3 pratikbaid3 added the bug Something isn't working label Jul 21, 2023
@RCGitBot
Copy link
Contributor

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@NachoSoto
Copy link
Contributor

NachoSoto commented Jul 21, 2023

Thanks!

You mentioned in #693 that you also use in_app_purchase. Are you implementing any observer that calls their completePurchase? That would be finishing transactions and would explain why the RevenueCat SDK can't get notified because that other library is removing transactions. You can read more about that here.

@pratikbaid3
Copy link
Author

@NachoSoto My issue is resolved. As you pointed out. I was also listening for purchases from in_app_purchase plugin causing the issue.

Thanks

@NachoSoto
Copy link
Contributor

Glad to hear! Let us know if you need any more help 👍🏻

@yolpsoftware
Copy link

@NachoSoto are you aware of #1082?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants