推送通知替代方案

发布于 2024-10-06 09:25:10 字数 260 浏览 0 评论 0原文

我听说推送通知不可靠。有什么替代方案吗?

我试图处理的用例是: 1.我有一个应用程序将由三种类型的组共享。每个组包含特定的一组人。 2. 第一种组提交请求,由第二种组提供服务。因此,属于第二组的所有人员都应收到通知,除他们之外的任何人都不应收到通知。 3. 同样,请求由第一种组提交,将由第三种组提供服务。因此,属于第三组的所有人员都应收到通知,除他们之外的任何人都不应收到通知。 4. 即使是第二组人员也可以向第三组人员提出请求。

请提供您的想法,我应该如何处理这些情况。

I heard that push notification is not reliable. What could be the alternative for this?

The use case I am trying to handle is:
1. I have a app which will be shared by three kind of groups. Each group contains certain set of persons.
2. A request is submitted by first kind of group and it will be serviced by second kind of group. So, all persons who are part of second group should be notified and no one apart from them should get the notification.
3. Similarly, A request is submitted by first kind of group and it will be serviced by third kind of group. So, all persons who are part of third group should be notified and no one apart from them should get the notification.
4. Even second group persons can submit a request to third group.

Please provide your thoughts as how should I handle these scenarios.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦幻之岛 2024-10-13 09:25:10

推送通知依赖网络 (3G/WiFi) 来传递通知。此外,Apple 推送通知服务器没有任何响应来保证通知的传送。说了这么多…… iPod touch 在发送通知方面非常不可靠,因为其一,它没有 3G;其次,为了节省电池,它的通知会在内部关闭一段时间......

对此的一种替代方法是在后台线程中不断轮询服务器是否有任何修改。但这仅在应用程序运行时才有效。

另一种选择是编写我们自己的 APNS 基础设施。

Push notifications rely on the network (3G/WiFi) presence to deliver the notification. Also, there is no response back from the Apple Push Notification Server which guarantee the delivery of the notification. Having said all these things... iPod touch is higly unreliable for delivery of notification because one, it do not have 3G; second, for saving battery its notifications are internally turned off for some time....

One Alternative to this is to keep polling the server in a background thread for any modification. But this will work only when app is running.

Another Alternative can be writing our own APNS kinda infrastructure.

一紙繁鸢 2024-10-13 09:25:10

您说推送通知不可靠是对的。
一方面,如果设备未连接到互联网,APN 只会在设备再次连接时保留一个要发送的推送通知(提供商发送的最后一条通知)。由于在您的服务器将通知发送到 APNS 后,无法确定通知是否已发送,因此您甚至无法尝试在您的端对通知进行排队。

除此之外,如果您的应用程序依赖于 PN,用户可以通过关闭通知轻松破坏其功能。

所以你是完全正确的,如果你想要发送的数据很关键,那么你不应该使用推送通知。但我相信你的问题确实没有解决办法。您根本不能依赖它们来让您的应用程序正常运行。

我认为最好的方法就像电子邮件应用程序一样,无论您是否打开 PN,您都可以在启动应用程序时下载电子邮件,并且 PN 只是通知您有新电子邮件,即使它不能保证您完全会得到它。

you're right to say Push Notifications are not reliable.
For one thing, if the device is not connected to the internet, APNs only keeps one push notification to be sent when the device connects again (the last notification sent from the provider). Since there's no way to determine if a notification has been already sent or not after your servers sent them to APNS, you can't even try to queue the notifications on your end.

Other than that if your app depends on PN the user can easily break it's functionality by turning notifications off.

So you're absolutely right, if the data you want to send is critical, then you shouldn't use Push Notification. But I believe there's really no solution to your problem. you simply can't rely on them for your app to work.

I think the best approach would be like the email app for example, where you can download your emails when you start the app wether you have PN turned on or not, and the PN just notify you of new email, even though it's not guaranteed you'll get it at all.

这个俗人 2024-10-13 09:25:10

没有其他选择,因为苹果公司进行了一些非常低级的通信。您需要与移动提供商合作来构建诸如通知服务之类的东西。

也就是说,我不认为这项服务不可靠。也许你应该检查你的实施。

There is no alternative, since Apple does some very low level communication. You would need to work together with the mobile providers to build something like the notification services.

That said, I don't think the service is not reliable. Maybe you should check your implementation.

巡山小妖精 2024-10-13 09:25:10

您是对的,APN 不保证交付:来自他们的 文档,他们说:

重要:由于无法保证交付,因此您不应依赖
用于将关键数据传送到的远程通知设施
通过有效负载的应用程序。并且切勿将敏感数据包含在
有效负载。您应该仅使用它来通知用户有新数据
可用。

You are right that APNs does not guarantee delivery: From their docs, they say that:

Important: Because delivery is not guaranteed, you should not depend
on the remote-notifications facility for delivering critical data to
an application via the payload. And never include sensitive data in
the payload. You should use it only to notify the user that new data
is available.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文