Skip to content

Commit 83553e9

Browse files
committed
fix start activity when click
1 parent de75e52 commit 83553e9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

android/src/main/java/cn/jpush/reactnativejpush/JPushModule.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -537,14 +537,14 @@ public void onReceive(Context context, Intent data) {
537537
// extra 字段的 json 字符串
538538
String extras = mCachedBundle.getString(JPushInterface.EXTRA_EXTRA);
539539
Intent intent;
540-
if (isApplicationRunningBackground(context)) {
541-
intent = new Intent();
542-
intent.setClassName(context.getPackageName(), context.getPackageName() + ".MainActivity");
543-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
544-
} else {
540+
// if (isApplicationRunningBackground(context)) {
541+
// intent = new Intent();
542+
// intent.setClassName(context.getPackageName(), context.getPackageName() + ".MainActivity");
543+
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
544+
// } else {
545545
intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
546546
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
547-
}
547+
// }
548548
intent.putExtras(mCachedBundle);
549549
context.startActivity(intent);
550550
mEvent = OPEN_NOTIFICATION;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jpush-react-native",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"description": "a jpush plugin for react native application",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)