Commit bb31de6b by TakeItEasyJQ

是通知的获取满足app已经在打开状态或者点击通知进入app的情况

parent 977ef7d5
......@@ -51,6 +51,11 @@ public class ONService extends CordovaPlugin {
this.coolMethod(message, callbackContext);
return true;
}
if (action.endsWith("getMessage")) {
callbackContext.success(NotificationService.getOfflineAll());
NotificationService.cleanOfflineBean();
return true;
}
// 开启并绑定服务并5秒间隔调取getHistory()
if (action.equals("bindService")) {
Intent intent = new Intent(cordova.getActivity(), NotificationService.class);
......
......@@ -38,4 +38,10 @@ ONService.unbindService = function () {
});
}
ONService.getMessage = function () {
return new Promise((resolve, reject) => {
exec(resolve, reject, PLUGIN_NAME, "getMessage", [...arguments]);
});
}
module.exports = ONService;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment