【发布时间】:2017-06-07 06:15:04
【问题描述】:
我正在从我的 Web 应用程序发送推送通知,它在 IOS 上运行良好,但在 Android 上,通知仅在很短的一秒钟内(可能更像几毫秒)作为顶部光点上的通知图标可见。通知警报列表中没有硝化作用(预览)。
我已按照开发者指南(Android 官僚机构)向 google 注册了该应用程序。如果我在对话框中显示它,我可以告诉应用程序正在收到通知。我只想让系统通知保持不变,以便用户知道他们需要检查应用程序。
应用代码:
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);
}
【问题讨论】:
标签: codenameone