简体   繁体   English

尝试打开时,Android Grouped Notification(来自OneSignal)使应用程序崩溃

[英]Android Grouped Notification (from OneSignal) crashes app when trying to open

Clicking on single notifications from OneSignal opens my app without issues, but if I have a grouped notification, it attempts to open the app and then closes it without much error. 单击OneSignal中的单个通知可以打开我的应用程序,而不会出现问题,但是如果我有分组的通知,它将尝试打开该应用程序,然后关闭它而没有太多错误。 The only thing I can really see of relevance in my output logs is there are multiple "Activity_launch_request", one for each notification in the group, as soon as I click the grouped notification. 我真正能看到的与输出日志相关的唯一一件事就是,有多个“ Activity_launch_request”,只要单击分组的通知,该组中的每个通知就一个。 (My device is a Xiaomi Mi Max, that tag may just be specific to this device) (我的设备是Xiaomi Mi Max,该标签可能仅适用于此设备)

Relevant notification click handling code: 相关通知点击处理代码:

        @Override
        public void notificationOpened(OSNotificationOpenResult result) {
            bug.out("notificationOpened");
            OSNotificationAction.ActionType actionType = result.action.type;
            JSONObject data = result.notification.payload.additionalData;

            Intent intent = new Intent(AndroidLauncher.this, AndroidLauncher.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
            PendingIntent contentIntent = PendingIntent.getActivity(AndroidLauncher.this, 0, intent, 0);
            try {
                contentIntent.send();
            } catch (PendingIntent.CanceledException e) {
                e.printStackTrace();
            }

        }

Note that even though "Activity_launch_request" gets fired "group_count" times, "notificationOpened" only gets printed once, so it's safe to say my launch intent only gets fired once. 请注意,即使“ Activity_launch_request”被触发了“ group_count”次,“ notificationOpened”也仅被打印了一次,因此可以肯定地说我的启动意图仅被触发了一次。

My activity launchMode is "singleTop". 我的活动launchMode是“ singleTop”。

Can someone please help me fix this issue? 有人可以帮我解决这个问题吗?

事实证明这是一个有效载荷和AndroidManifest问题,我们的网站网址位于有效载荷中,而我的AndroidManifest具有一个意图过滤器,用于从我们的网址启动该应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android 应用程序在 OneSignal 推送通知上崩溃 - Android App crashes on OneSignal push notification Android OneSignal,从通知中打开特定片段 - Android OneSignal , open specific fragment from notification OneSignal:收到通知时Android应用程序崩溃 - OneSignal: Android app craches when notification received 点击通知栏并在应用终止时打开通知活动(onesignal) - tap notification bar and open notification activity when app kill (onesignal) 离子1信号有一种方法可以知道从背景到前景打开应用程序或启动应用程序时是否有推送通知 - ionic 1 onesignal is there a way to know if there is a push notification when open app from background to foreground or launching app Android / OneSignal-知道单击的通知是否已分组 - Android / OneSignal - Know if the clicked notification was grouped 当您收到带有单信号的推送通知时,将自动打开应用程序 - Open the app automatically when you receive a push notification with onesignal 发送OneSignal推送通知时,Android应用程序崩溃 - Android App crashes when OneSignal push notifications are sent Flutter 在 android 上初始化 OneSignal 时应用程序崩溃 13 - Flutter app crashes when initialize OneSignal on android 13 尝试打开文本文件时 java 中的 Android 应用程序崩溃 - Android app in java crashes when trying to open a text file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM