ios替代通过使用iCloud(例如“查找我的iPhone")推送通知 [英] ios alternative to push notification by using iCloud like "find my iPhone"

查看:169
本文介绍了ios替代通过使用iCloud(例如“查找我的iPhone")推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在查看查找我的iPhone"应用程序,似乎它正在使用iCloud且没有推送通知来接收有关通知的alertView.通过在后台运行某种机制,并在收到通知后提醒用户.

I have been looking at the "find my iPhone" app and it seems like it is using iCloud and no push notification to receive a alertView about a notification. By having some mechanism in the background running and alerting the user once it receives a notification.

我想知道的是,此应用程序是Apple为该应用程序做出的特殊例外,而所有其他应用程序都必须执行推送通知吗?还是我可以制作一个在后台运行的应用程序,就像查找我的iPhone"应用程序并通过iCloud进行通信.

What I am wondering is that is this app a special exception Apple made for this app, and all other apps have to do push notification? Or can I make an app that runs in the background just like the "find my iPhone" app and communicate via iCloud.

谢谢.

推荐答案

Apple使用iCloud来查找我的iPhone,是的,但是我相信他们这样做的原因是将它与您的iCloud帐户绑定在一起,这样,如果您的手机被盗了,您可以在icloud.com上登录您的帐户以尝试对其进行跟踪. 查找我的iPhone"应用程序本身可以通过ping GPS位置,保存该位置并将其与iCloud同步来工作.但是,对于一般开发人员而言,没有直接的API可用于通过iCloud进行通信,也可能不会. iCloud的主要目的是同步和备份,并且由于Apple已经提供了推送通知服务,因此在这一点上将其放入iCloud是没有意义的.您想要Apple的Push不允许哪些功能?

Apple uses iCloud for Find My iPhone, yes, but I believe their reason for this is tying it to your iCloud account so that if your phone is stolen, you can log in your account at icloud.com to attempt to track it. The Find My iPhone app itself works by pinging the GPS location, saving that location, and syncing it with iCloud. For general developer use however, there's no direct API for communicating via iCloud, nor is it likely there will be. iCloud's main purpose is synchronization and backup, and since Apple already has the Push Notification service in place it wouldn't make sense at this point to put that in iCloud. What functionality are you wanting that Apple's Push doesn't allow?

当您的应用程序位于前台时,您可以通过多种方法从外部源接收数据.但是,当您的应用程序被用户或系统内存监视程序终止时,推送通知才是唯一的选择.因此,在此阶段,集成APNS是您的最佳解决方案.有一些很棒的服务使APNS集成相对轻松,例如城市飞艇.

When your app is in the foreground you have the capability of receiving data from an external source a number of different ways. However when your app is terminated either by the user or the system memory watchdog, Push Notifications are the only real route. So at this stage, integrating the APNS is your best solution. There's a few great services that make APNS integration relatively painless, such as Urban Airship.

这篇关于ios替代通过使用iCloud(例如“查找我的iPhone")推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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