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。
轉載于:https://www.cnblogs.com/tara/archive/2012/02/25/2368016.html
總結
以上是生活随笔為你收集整理的iPhone客户端开发笔记(八)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 试写函数显示当前具体时间:
- 下一篇: xml.modify() 实例演示(二)