jpush-react-native icon indicating copy to clipboard operation
jpush-react-native copied to clipboard

作者您好,点击通知栏的推送消息,当前app重新打开,这是什么原因

Open Jonauil opened this issue 10 years ago • 2 comments

Jonauil avatar Oct 25 '16 15:10 Jonauil

是因为在 JPushModule 235行 onReceive 方法,收到点击通知栏的事件后,如果 mModule.mContext 为 null, 执行了:

String packageName = context.getApplicationContext().getPackageName();
                    Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
                    launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                    launchIntent.putExtras(bundle);
                    context.startActivity(launchIntent);

所以才会重新打开 App

KenChoi1992 avatar Oct 27 '16 02:10 KenChoi1992

已解决,非常感谢!

Jonauil avatar Oct 27 '16 05:10 Jonauil