Skip to content

Commit

Permalink
fix start activity when click
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLipan committed May 8, 2018
1 parent de75e52 commit 83553e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions android/src/main/java/cn/jpush/reactnativejpush/JPushModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 83553e9

Please sign in to comment.