当应用程序未运行时收到推送通知并且用户按下通知时,它就会消失并且日志显示:
2019-10-22 12:42:45.747 23260-23260/de.app.test.staging E/FirebaseMessaging: Notification pending intent canceled
这是应该作为 Launcher Activity 启动的 SplashActivity:
<activity
android:name="de.app.test.login.SplashActivity"
android:screenOrientation="portrait"
android:exported="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
这里有什么问题?
最佳答案
对于任何寻找答案的人来说,后端都会将“click_action”发送到通知,因此该 Activity 没有 Intent 过滤器。
对我来说,click_action 是“OPEN_ACTIVITY_1”,所以我只是在我的 SplashActivity 中添加了一个 Intent 过滤器,如下所示:
<intent-filter>
<action android:name="OPEN_ACTIVITY_1" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
关于android - 点击通知未启动应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58502528/