[英]How I can Open Android Application Automatically Once The Phone Received notification Without any user interaction
我搜索如何在没有用户交互的情况下自动打开 Android 应用程序一旦应用程序收到 FCM,我知道逻辑会将它放在方法 onMessageReceived 上,我不知道应用程序将如何在没有用户按下通知的情况下打开活动,应用程序自动打开
in your methods onMessageReceived() write somting like在您的方法 onMessageReceived() 中编写类似
Intent dialogIntent = new Intent(TrackingService.this, RequestView.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialogIntent);
here is my full code in github but the start activity method will be good but take care you have to add the FLAG_ACTIVITY_NEW_TASK as i did in the above code to open activity when the app is close这是我在github 中的完整代码,但是 start Activity 方法会很好,但是请注意您必须像我在上面的代码中所做的那样添加 FLAG_ACTIVITY_NEW_TASK 以在应用程序关闭时打开 Activity
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.