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

setObserver(this) not working #146

Open
Unevenn opened this issue Jan 25, 2025 · 1 comment
Open

setObserver(this) not working #146

Unevenn opened this issue Jan 25, 2025 · 1 comment

Comments

@Unevenn
Copy link

Unevenn commented Jan 25, 2025

adapty_flutter: ^3.3.1

In this version adapty setObserver(this) not working. Calllbacks are not working. For now i downgraded the version the 3.2.0 and works.

@x401om
Copy link
Collaborator

x401om commented Jan 31, 2025

Hi @Unevenn!

Please don’t forget to set withActivateUI(true) when calling activate and also use setupAfterHotRestart to ensure the plugin remains functional during debug sessions. Additionally, make sure to call setObserver every time your application loads, regardless of whether it’s the first start or a hot restart.

var isActivated = false;

if (kDebugMode) {
    isActivated = await Adapty().isActivated();
} else {
    isActivated = false;
}

if (!isActivated) {
    await Adapty().activate(
        configuration: AdaptyConfiguration(apiKey: 'YOUR_API_KEY')
            ..withActivateUI(true),
    );
} else {
    Adapty().setupAfterHotRestart();
}

AdaptyUI().setObserver(this);

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

No branches or pull requests

2 participants