iOS“thread-id”不会将推送通知分组 [英] iOS "thread-id" doesn't group push notifications

查看:1013
本文介绍了iOS“thread-id”不会将推送通知分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自



我预计它们与其他通知在视觉上有所不同......或者是当其他通知进入时,它们组合在一起。在我们的测试中,情况都不是这样。



我做错了什么?或者我误解了这个功能?

解决方案

不幸的是,你没有免费获得这个功能。您需要创建一个 Notifictation UI 扩展,并实现您自己的UI(在这种情况下,它是一个会话UI),并在收到新通知时更新用户界面thread-id。


From the documentation:

thread-id | string | When displaying notifications, the system visually groups notifications with the same thread identifier together. For remote notifications, the value of the threadIdentifier property is set to the value of this request header.

Our push notification payloads:

{
    aps =     {
        alert =         {
            body = "Leeroy J asked you: Test Push Notification";
        };
        badge = 12;
        sound = default;
        "thread-id" = 9150;
    };
    n = "6kQ/0x6556";
    r = 9150;
}

{
    aps =     {
        alert =         {
            body = "Leeroy J re: Test Push Notification";
        };
        badge = 13;
        sound = default;
        "thread-id" = 9150;
    };
    n = "6l8/0x6582";
    p = 7197;
    r = 9150;
}

Here's what it looks like in Message Center:

I expected them to be visually different than other notifications... either that or grouped together when other notifications come in between. In our testing, neither is the case.

What am I doing wrong? Or am I misunderstanding this feature?

解决方案

Unfortunately, you don't get this for free. You need to create a Notifictation UI extension, and implement your own UI(in this case it's a conversation UI), and update the UI when receive new notification with same thread-id.

这篇关于iOS“thread-id”不会将推送通知分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆