peo*_*mes 6 java notifications ios codenameone
我添加了一个本地通知,所以当我的应用程序在打开时进行推送时,仍然会有弹出窗口和声音.它在Android上工作正常,但在iOS上本地通知根本没有出现.
推送通知在两个平台上都运行良好.
这是我应该触发通知的推送回调中的代码(如果应用程序处于打开状态):
if(Display.getInstance().getCurrent() != null) {
LocalNotification n = new LocalNotification();
n.setId(value);
n.setAlertBody(value);
n.setAlertTitle({app name});
n.setBadgeNumber(1);
Display.getInstance().scheduleLocalNotification(n, System.currentTimeMillis() + 1000, LocalNotification.REPEAT_NONE);
}
Run Code Online (Sandbox Code Playgroud)