在后台处理 APNS 远程通知 [英] Handle APNS Remote Notifications while in Background

查看:29
本文介绍了在后台处理 APNS 远程通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 AppDelegate 中实现了所有推荐的方法来启动远程通知服务.

I have implemented all recommended methods in AppDelegate to get working Remote Notifications service.

我可以在运行、启动和关闭时接受它们.

I can accept them while running, while launching and while turned off.

但是有一个问题,因为我无法在后台处理许多收到的通知.我只能处理最新通知.

But there is an issue, since I can't work with many received notifications while in background. I can work only with latest notification.

推荐的手册是什么?如何在后台收到所有通知?是否只能通过手动调用我的服务提供商(apns 数据的发送方)来解决?

What is recommended manual to do that? How can I got all notifications received while in background? Is it only solvable via manual call to my service provider (sender of apns data)?

推荐答案

对于我参与的所有项目,如果取消推送通知,还没有办法在本地存储此信息.在所有这些情况下,我们在服务器上使用了一个小文件,应用程序将连接到该文件并在它再次激活时拉取.应用程序中还有一些地方可供用户查看所有通知,这些通知再次存储在服务器上以供快速检索.

With all the projects I've worked on there hasn't been a way to locally store this information if the push notification is dismissed. In all those cases we used a small file on the server that the app would connect to and pull when it became active again. There was also some place in the app where the user could see all their notifications which, again, were stored on the server for quick retrieval.

按照我理解的推送通知设置方式,如果通知被取消,系统将丢弃它.它会执行它应该做的任何事情(例如更新徽章编号并播放正确的声音),但特定于该通知的任何其他信息都将丢失.

With the way I understand push notifications to be setup, if the notification is dismissed the system discards it. It'll perform anything it's supposed to do (such as update the badge number and play the correct sound) but any additional information specific to that notification is lost.

这篇关于在后台处理 APNS 远程通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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