如何安排重复的苹果推送通知?
我想知道是否可以设置重复推送通知。我想这样做的原因是允许我的用户在特定时间安排每日提醒。这可能吗?目前我能想到的唯一选择是:
- 安排大量通知,比如在接下来的 30 天内每个通知一个。然后,每次启动应用程序时“充值”通知,
- 允许用户仅选择特定时间(例如凌晨 1 点、凌晨 2 点、凌晨 3 点),然后让服务每小时运行一次,并向已注册的设备发送批量通知对于那个时间段。
我计划使用 Urban Airship 平台,但我愿意接受其他建议。
I am wondering if it is possible to setup repeating push notifications. The reason I want to do this is to allow my users to schedule a daily reminder at a particular time. Is this possible? Currently the only options I can think of are:
- schedule a lot of notifications, say one each for the next 30 days. Then "top up" the notifications every time the app is launched
- allow the user's to only pick specific times (eg. 1am, 2am, 3am), and then have a service runs once per hour and sends out batch notifications to devices that have registered for that timeslot.
I am planning to use the Urban Airship platform, but am open to other suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前,任何主要服务提供商(Airship、iLime、App Notify)均不支持定期通知。 iLime 和 App Notify 很快就会以某种形式推出此功能,而 Airship 则不会(至少在不久的将来)。所有这些都是基于与这些公司的直接通信。我建议使用 cron 作业在您自己的服务器上实现调度部分,然后使用如下代码将推送请求发送到 Urban Airship(或您选择的任何人): http://bitbucket.org/urbanairship/push_sample/
Recurring notifications are not currently supported by any of the major service providers (Airship, iLime, App Notify). iLime and App Notify are rolling out this feature in some form soon, Airship is not (at least in the near future). All of this is based on direct correspondence with these companies. I suggest either implementing the scheduling part on your own server using cron jobs and then sending the push request to Urban Airship (or whomever you choose) using code like this: http://bitbucket.org/urbanairship/push_sample/
您还可以查看 用于开发 iPhone 推送通知服务的 Google App Engine 的 Java 替代方案是什么?
You can also take a look What's a Java alternative to Google App Engine for developing iPhone Push Notification services?