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

Purchases.isConfigured always returns true #1210

Open
11 tasks done
Ankooo12 opened this issue Nov 15, 2024 · 5 comments
Open
11 tasks done

Purchases.isConfigured always returns true #1210

Ankooo12 opened this issue Nov 15, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Ankooo12
Copy link

Ankooo12 commented Nov 15, 2024

Environment

  • Output of flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.4, on macOS 15.0 24A335 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] Connected device (10 available)
[✓] Network resources

  • Version of purchases-flutter
    >=3.24.0
  • Testing device version
    Android API 34
  • How often the issue occurs- every one of your customers is impacted? Only in dev?
    • Only in dev
  • Debug logs that reproduce the issue
PurchasesError(code=InvalidCredentialsError, underlyingErrorMessage=Invalid API Key., message='There was a credentials issue. Check the underlying error for more details.') 
  • 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.)
  1. Added dummy Api Key dummy.
  2. Run the app.
  3. Check that the message is printed in the console.
  4. Hot restart the app.
  5. Still That error

Describe the bug

I have added a dummy API key in Purchases.configure(configuration) and encountered error logs. However, when I call Purchases.isConfigured, it returns true. Please help resolve this issue. Note that it works fine when the API key is empty.

Additional context

I've tried multiple times, but the issue persists.

@Ankooo12 Ankooo12 added the bug Something isn't working label Nov 15, 2024
@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!

@aboedo
Copy link
Member

aboedo commented Nov 15, 2024

@Ankooo12 the isConfigured method will return true whenever at least one call to configure has been made in the lifecycle of the app, regardless of whether the API key is correct.

In hindsight maybe we could improve the API to take that into account, but this is as of right now the behavior.

What use case are you trying to solve? Maybe we can help figure it out

@Ankooo12
Copy link
Author

We sell app templates, and we need to verify whether our customers have configured them correctly. It was working fine before, but I believe there might be an issue with the updates.

@michaelAtRC
Copy link

Hey There,

The API key being correct will be needed to properly configure the SDK. This will ensure that the current app user ID is able to be created. With this being said, the error is correct if you're are passing in not the API key found in your project settings.

You said that this worked previously just passing in the "dummy" API key, did you recently update versions?

@Ankooo12
Copy link
Author

If I enter a dummy API key, isConfigured should not return true after calling Purchases.configure(configuration). We recently encountered this issue but resolved it by using an empty string for the API key. Please check if there's anything you can do to address this; otherwise, I will consider closing the issue

Version: purchases_flutter: ^8.2.1

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