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

TrueLayerPaymentsSDKWrapper.configure ~crashes~ throws an error on Android when calles second time (but works fine on iOS) #73

Open
olessavluk opened this issue Mar 4, 2024 · 4 comments

Comments

@olessavluk
Copy link

olessavluk commented Mar 4, 2024

Hey,

When I initialize library with different environment using TrueLayerPaymentsSDKWrapper.configure(Environment.Sandbox) (or .Production) - it works fine on iOS.

But crashes returns cryptic error on Android:

{
    "nativeStackAndroid": [],
    "userInfo": null,
    "message": "Error not specified.",
    "code": "EUNSPECIFIED"
}

Would you be able to support dynamic env switching as it's handly for testing? And if not - would be nice to get consistent behaviour & proper error message explaining reason.

@tl-keenen-charles
Copy link
Contributor

Hey Oles, we currently don't support env switching on Android and it requires relaunching the app to take effect. Would definitely be handy to add in the future when we can get to it.

@tl-keenen-charles
Copy link
Contributor

Hey Oles, we've looked into this crash and haven't been able to reproduce it. Can you share how you're using the configure method? For reference if you call configure twice on Android with different environments it should return an error saying that configuration has failed not crashing. This is how we recommend you use it.

    TrueLayerPaymentsSDKWrapper.configure(
          Environment.Sandbox,
          theme,
        ).then(
          () => {
            log('Configure success')
          },
          reason => {
            log(
              'Configure failed ' +
                JSON.stringify(reason.userInfo),
            )
          },
        )

@olessavluk olessavluk changed the title TrueLayerPaymentsSDKWrapper.configure crashes on Android when calles second time TrueLayerPaymentsSDKWrapper.configure ~crashes~ throws an error on Android when calles second time (but works fine on iOS) Mar 25, 2024
@olessavluk
Copy link
Author

olessavluk commented Mar 25, 2024

Sorry, I meant it throws an error (like on top), not crashes. You can reproduce by calling .configure(...) 2 times but with different environment.

@scott-harrison
Copy link

scott-harrison commented May 20, 2024

Im also getting this same issue. I believe it happens when the app attempts to reload in metro and configure gets recalled it will fail. with

{
    "nativeStackAndroid": [],
    "userInfo": null,
    "message": "Error not specified.",
    "code": "EUNSPECIFIED"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants