Codename one Android Push Notifications being dismissed immediately

Viewed 85

I am sending a push notification from my web application and it is working great on IOS, but on Android the notification is only noticeable for a brief second (probably more like a couple milliseconds) as the notification icon along the top blips. There is no nitrification in the notification alerts list (preview).

I have registered the app with google per the Developer guide (Android Bureaucracy). And I can tell the app is getting the notification if I show it in a dialog. I just want the system notification to stick so the user knows they need to check the app.

App Code:

public void start() {
    if(current != null){
        current.show();
        return;
    }
    Display.getInstance().callSerially(() -> {
        Display.getInstance().registerPush();
    });

    // show the splash screen
    splashScreen.show();
}

public void stop() {
    current = Display.getInstance().getCurrent();
    if(current instanceof Dialog) {
        ((Dialog)current).dispose();
        current = Display.getInstance().getCurrent();
    }
}

public void destroy() {
}

@Override
public void push(String value) {
    //Dialog.show("push", "value:" + value, "OK", "Cancel");
}

@Override
public void registeredForPush(String deviceId) {
    //String pushKey = Push.getPushKey();
    //System.out.println("deviceId:" + deviceId + ", pushKey:" + pushKey);
}

@Override
public void pushRegistrationError(String error, int errorCode) {
    //System.out.println("Unable to register push:" + errorCode + ":" + error);
}
2 Answers
Related