Skip to content

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

@victorvhpg

Description

@victorvhpg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions