如何向您的应用程序添加推送通知服务?

发布于 2024-10-02 11:52:02 字数 268 浏览 1 评论 0原文

我想将Apple推送通知服务添加到我的应用程序中。详细信息是:

我的应用程序将存储一些重要的个人数据,因此,我想确保当有人丢失他/她的iPhone时,他/她可以向提供信息的服务器报告当服务器收到报告时,它会向APNS发送通知,然后APNS向iPhone发送推送通知并调用该应用程序删除相关数据。 这是我的问题:

  1. 如何开始这一切?我应该申请任何认证或身份证明吗?

  2. 是否可以调用当时可能未运行的应用程序来删除某些数据?

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:

  1. How to begin all these? Should I apply any certification or ID?

  2. Is it possible to call a app that might not be running at the time to delete some data?

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

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

发布评论

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

评论(2

故人爱我别走 2024-10-09 11:52:02

我会前往 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!

段念尘 2024-10-09 11:52:02

Apple Developer 中有大量信息:

http ://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html

进行快速测试的最简单方法是查看 easyapns 文档。当您在 iOS 配置门户 中创建 AppID 时,您必须将其配置为Apple 推送通知服务(阅读“操作方法”选项卡)。

如果您的应用程序未运行,则没有问题,当收到推送时,UIApplicationDelegate 将通过以下消息通知您的应用程序:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

您必须在此处放置删除代码。

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:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

There is where you must place your deletion code.

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