diff --git a/android/src/main/java/cn/jpush/reactnativejpush/JPushModule.java b/android/src/main/java/cn/jpush/reactnativejpush/JPushModule.java index b341466e..2687c4d2 100644 --- a/android/src/main/java/cn/jpush/reactnativejpush/JPushModule.java +++ b/android/src/main/java/cn/jpush/reactnativejpush/JPushModule.java @@ -537,14 +537,14 @@ public void onReceive(Context context, Intent data) { // extra 字段的 json 字符串 String extras = mCachedBundle.getString(JPushInterface.EXTRA_EXTRA); Intent intent; - if (isApplicationRunningBackground(context)) { - intent = new Intent(); - intent.setClassName(context.getPackageName(), context.getPackageName() + ".MainActivity"); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); - } else { +// if (isApplicationRunningBackground(context)) { +// intent = new Intent(); +// intent.setClassName(context.getPackageName(), context.getPackageName() + ".MainActivity"); +// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); +// } else { intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); - } +// } intent.putExtras(mCachedBundle); context.startActivity(intent); mEvent = OPEN_NOTIFICATION; diff --git a/package.json b/package.json index dc5f03b6..1934f9cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jpush-react-native", - "version": "2.2.1", + "version": "2.2.2", "description": "a jpush plugin for react native application", "main": "index.js", "scripts": {