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

[Bug]:On Android lifecycleInit() never complete a Future. #937

Open
2 of 3 tasks
victorvhpg opened this issue Aug 20, 2024 · 1 comment
Open
2 of 3 tasks

[Bug]:On Android lifecycleInit() never complete a Future. #937

victorvhpg opened this issue Aug 20, 2024 · 1 comment

Comments

@victorvhpg
Copy link

victorvhpg commented Aug 20, 2024

What happened?

In Android all lifecycleInit method don't complete the Future, java needs a result like iOS do.

iOS

- (void)lifecycleInit:(FlutterMethodCall *)call withResult:(FlutterResult)result {

- (void)lifecycleInit:(FlutterMethodCall *)call withResult:(FlutterResult)result {
    [OneSignal.Notifications addForegroundLifecycleListener:self];
    [OneSignal.Notifications addPermissionObserver:self];
    result(nil);
}

Android

    private void lifecycleInit() {
        OneSignal.getNotifications().addForegroundLifecycleListener(this);
        OneSignal.getNotifications().addPermissionObserver(this);
    }

Steps to reproduce?

this Future never completes on Android      
 await OneSignal.Notifications.lifecycleInit();

What did you expect to happen?

complete the Future

OneSignal Flutter SDK version

Release 5.2.3

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

@victorvhpg thanks for reaching out! We'll look into 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