如何向您的应用程序添加推送通知服务?
我想将Apple推送通知服务添加到我的应用程序中。详细信息是:
我的应用程序将存储一些重要的个人数据,因此,我想确保当有人丢失他/她的iPhone时,他/她可以向提供信息的服务器报告当服务器收到报告时,它会向APNS发送通知,然后APNS向iPhone发送推送通知并调用该应用程序删除相关数据。 这是我的问题:
如何开始这一切?我应该申请任何认证或身份证明吗?
是否可以调用当时可能未运行的应用程序来删除某些数据?
I want to add Apple push notification service to my app.The detail is:
my app will store some important personal data,so ,i want to sure that when someone lost s/he's iPhone,s/he can report to the server which provide service to my app.When the server receive the report,it'll send a notification to the APNS,then the APNS send a push notification to the iPhone and call that app to delete the relative data.
Here is my question:
How to begin all these? Should I apply any certification or ID?
Is it possible to call a app that might not be running at the time to delete some data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会前往 Urban Airship 并尝试他们对 Apple 推送通知的实现。他们有一个示例应用程序,您可以对其进行扩展以满足您的需求,并提供有关如何启动和运行示例应用程序的详细分步文档。
许多“我的 iPhone 在哪里”应用程序已经在使用您所描述的方法来定位 iPhone 的地理位置。
快乐编码!
I'd head on over to Urban Airship and play around with their implementation of Apple Push Notifications. They have a sample application you can extend to fit your need and great step-by-step documentation on how to get your sample application up and running.
A number of "where is my iPhone" app's out there are already using the approach you are describing to geographically locate an iPhone.
Happy coding!
Apple Developer 中有大量信息:
http ://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html
进行快速测试的最简单方法是查看 easyapns 文档。当您在 iOS 配置门户 中创建 AppID 时,您必须将其配置为Apple 推送通知服务(阅读“操作方法”选项卡)。
如果您的应用程序未运行,则没有问题,当收到推送时,
UIApplicationDelegate
将通过以下消息通知您的应用程序:您必须在此处放置删除代码。
There are tons of information in Apple Developer:
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html
The easyest way to do a quick test is look into easyapns documentation. When you create your AppID in the iOS Provisioning Portal you must configure it for Apple Push Notification service (read the "how to" tab).
There is no problem if your app is not running, when a Push is recieved, your app will be notifyed by the
UIApplicationDelegate
with this message:There is where you must place your deletion code.