iPhone客户端开发笔记(八)

 

客户端稳定性和提升用户体验。

 

1,掌握app的运行状态

这是官方文档中关于Application State的详细描述:

https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html\

 

2,尝试在后台接收报警信息的尝试:后台运行。

这是官方文档中关于后台和多任务的详细描述:

https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

经研究发现后台运行在iOS下限制很多,iOS只针对几类功能提供了后台执行能力:播放音乐、GPS导航、跟外围设备通信、蓝牙通信等。所以不太适合我们这个应用。

 

3,尝试使用Push Notification接收报警信息:

这是对Remote Push Notification机制的概述:

https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html

要实现push notification,需要以下三部分知识:

a,Scheduling, Registering, and Handling Notifications

https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW1

b,Apple Push Notification Service

https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9

c,Provisioning and Development

https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW1

d,Provider Communication with Apple Push Notification Service

https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW1

最终决定使用这种方式实现报警信息推送。

 

4,这是stackoverflow中关于如何实现Provider server的问答:

http://stackoverflow.com/questions/7791549/how-to-create-a-server-for-apns-for-iphone

 

That‘s all。

posted @ 2012-02-25 18:41  勤劳的天蓬  阅读(348)  评论(0编辑  收藏  举报