Pushnotification横幅没有显示 - ios9

时间:2016-06-22 12:28:04

标签: push-notification apple-push-notifications ios9 banner

在从后端添加任何事件时,我启用了一个启用了pushnotification的ios项目。一切都很好;显示badgealertsound一切正常,除了“banner”。应用程序处于后台模式时,横幅未显示,我认为没有任何内容可以为我们的“横幅”编码。这就是我注册pushnotification的方式。

 UIUserNotificationType types = UIUserNotificationTypeBadge |
        UIUserNotificationTypeSound | UIUserNotificationTypeAlert;

        UIUserNotificationSettings *mySettings =
        [UIUserNotificationSettings settingsForTypes:types categories:nil];

        [[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
        [[UIApplication sharedApplication] registerForRemoteNotifications];

1 个答案:

答案 0 :(得分:0)

这是因为从后端发送的有效负载越过了允许的大小限制。 根据{{​​3}}允许的最大大小为:

  • 对于常规远程通知,最大大小为4KB(4096 字节)
  • 对于互联网协议语音(VoIP)通知,最大值 大小为5KB(5120字节)注