`
shappy1978
  • 浏览: 698438 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Apple Push Notification Service memo

阅读更多

指南:http://blog.csdn.net/zu12jing/archive/2010/09/02/5859274.aspx

官方说明:http://urbanairship.com/docs/push.html

 

AppId 用于绑定你的应用

Certificate *.cer  密钥,推送的服务器需要的加密密钥,如果是非mac服务器,需要导入Key chain后导出为p12文件才能使用,参考中说到有开发和产品的,测试时发现用产品的密码可以成功发送,但是iphone没响应,还是用回开发的密钥。

Development or Production?

When you create or edit an application record on our server, you have to select where your app system is In development, connecting to test servers, or In production, connecting to real push servers. Apple treats the two servers completely separately, so a device token for development/sandbox will not work on production/distribution.

When building your app using a development provisioning profile, set your Urban Airship application to In development, and upload the development Push SSL certificate. To push to an app built with a distribution provisioning profile (either with a release build in XCode, ad-hoc distribution, or the iTunes App Store), use an application that is In production, and upload the production Push SSL certificate.

Because Apple treats development and production/distribution as completely separate instances, we suggest making two applications in the Urban Airship web interface. That way you can continue to build and develop your application even after releasing it without interrupting your users.

 

 

Provisioning *.mobileprovision  开发机上需要安装的授权文件,制作的时候必须绑定设备

 

device token :一个设备有一个唯一的token,不同的程序注册通知都会得到相同的token,apns依靠服务器发送的密钥文件判断应该由那个app接收。据说jb过后无法获取token。

这里官方的解释是unlock,似乎应该是解锁,我测试的结果,jail break后确实可以注册(register a device token),也可以收到通知。另外restore firmwork后,注册会获得新的device token,说明这个token虽然和设备有关,但是并不是一定唯一的。

//*********************************************************

My iPhone is unlocked to work on other carriers, and my application fails to register a device token.

Unlocked iPhones cannot use Apple’s Push Notification service, even over wifi. While we’ve heard reports of hacks that can enable this on phones, we don’t know the efficacy of the methods and we cannot support them.

 

//***************************************************

所谓的notification其实和wap push还是有一定区别的,wap push会直接启动应用程序来接收推送信息,notification必须要按了显示才会处理信息,所以实际上app是没有启动的,从这点上看,离线状态下是无法有效下bomb的。

另外一个问题则是无法确认推送服务器的权威性,实际上只要获取到cer或者p12的密钥文件,任何一个服务器都是给iPhone推送通知,也就是说只要我获取了某个常用软件的通知密钥(比如appStore的密钥),然后黑客又能从apple的服务器上窃取到大量的device token,那么就可以发一堆垃圾广告了;或者知道某个小妞的token,就可以无法受阻的发送骚扰信息,嘿嘿,太邪恶了!这种信息无法查看到发送人,当然可以在设置的通知中关闭,如果能够搞到类似App Store这样无法删除的系统程序的密钥,那么你除了关掉网络,或者换个手机(他和sim卡无关,绑定到手机),别无他法。

 

没锁频的情况下,会弹出提示是否显示,锁频时,解锁则是代表显示,所以只能按关闭键取消。apns似乎会对json重新封装,并把field(字段名)的引号去掉,导致json无法识别。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics