mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-19 13:52:49 +08:00
修复程序彻底退出后,点击通知收不到消息的bug
This commit is contained in:
parent
b10bc7dbb4
commit
c2f957acbe
@ -58,6 +58,8 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
|
|
||||||
public static String notificationAlert;
|
public static String notificationAlert;
|
||||||
public static Map<String, Object> notificationExtras=new HashMap<String, Object>();
|
public static Map<String, Object> notificationExtras=new HashMap<String, Object>();
|
||||||
|
public static String openNotificationAlert;
|
||||||
|
public static Map<String, Object> openNotificationExtras=new HashMap<String, Object>();
|
||||||
|
|
||||||
public JPushPlugin() {
|
public JPushPlugin() {
|
||||||
instance = this;
|
instance = this;
|
||||||
@ -67,6 +69,16 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
||||||
super.initialize(cordova, webView);
|
super.initialize(cordova, webView);
|
||||||
//JPushInterface.setDebugMode(true);
|
//JPushInterface.setDebugMode(true);
|
||||||
|
|
||||||
|
//JPushPlugin.notificationAlert = alert;
|
||||||
|
//JPushPlugin.notificationExtras = extras;
|
||||||
|
if(JPushPlugin.openNotificationAlert != null){
|
||||||
|
JPushPlugin.transmitOpen(JPushPlugin.openNotificationAlert, JPushPlugin.openNotificationExtras);
|
||||||
|
}
|
||||||
|
if(JPushPlugin.notificationAlert!=null){
|
||||||
|
JPushPlugin.transmitReceive(JPushPlugin.notificationAlert, JPushPlugin.notificationExtras);
|
||||||
|
}
|
||||||
|
|
||||||
//JPushInterface.init(cordova.getActivity().getApplicationContext());
|
//JPushInterface.init(cordova.getActivity().getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ public class MyReceiver extends BroadcastReceiver {
|
|||||||
launch.addCategory(Intent.CATEGORY_LAUNCHER);
|
launch.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||||
launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
|
||||||
JPushPlugin.notificationAlert = alert;
|
JPushPlugin.openNotificationAlert = alert;
|
||||||
JPushPlugin.notificationExtras = extras;
|
JPushPlugin.openNotificationExtras = extras;
|
||||||
|
|
||||||
JPushPlugin.transmitOpen(alert, extras);
|
JPushPlugin.transmitOpen(alert, extras);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user