Apple推播通知服務

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
蘋果推播通知服務
產品類型通知
持有者Apple Inc.
國家/地區美國
建立2009
目標市場世界
網站https://developer.apple.com/notifications/
「Apple 推播通知服務」的各地常用名稱
中國大陸Apple 推送通知服務
臺灣Apple 推播通知服務

Apple 推播通知服務(英文:Apple Push Notification service,APNs)是蘋果公司於2009年6月17日隨iOS 3推出的一項服務。它通過長連接推播技術從第三方應用向蘋果裝置提供推播通知服務英語Notification Service,通知中可能包括標記、聲音、提醒/橫幅。在iOS 5中,通知中心加強了推播和本地通知的用戶體驗。Apple 推播通知服務也以API的形式添加到了Mac OS X Lion(10.7)中供開發者使用,並在OS X 10.8 「Mountain Lion」中加以改進成為通知中心

在Mac OS X Lion上,應用也可以使用與iOS相同的API來向Mac OS X上的程式推播資訊。OS X Mountain Lion發佈後,用戶可以通過通知中心收取推播通知。如果推播資訊時應用並未執行,則會有數字標記出現且應用並會被添加至dock中(直到標記被清除)來提醒用戶。

Mac OS X 伺服器使用 Apple 推播通知服務向聯網用戶推播伺服器郵件、行事曆和聯絡資訊。像是iPhone一類的裝置和郵件、行事曆一類的應用都能收到來自 Mac OS X 伺服器的推播通知。

使用 Apple 推播通知服務推播單條通知的體積最大為 256 位元組。

歷史

蘋果公司於2008年6月9日宣佈推出這項服務,原定於當年 9 月發佈;正如史葛·福斯特爾在2009年3月17日的 iOS 3.0 預覽活動上所說,由於 APNs 的發佈據稱引起了"壓倒性"的反響,出於可延伸性目的,蘋果公司決定重組 APNs,從而推遲了這項服務的推出。在這兩次活動中,福斯特爾表示,推播技術後台行程(用於拉取技術)推播通知更節省電量。[1]

APNs 於2009年6月17日與 iOS 3.0 一起首次推出。[2]iOS 5.0 的發佈包含了一個通知中心,增加了在一個地方接收和讀取本地通知的支援。[3]

APNs 還作為 API 添加到 Mac OS X 10.7("Lion")中,這樣開發人員就可以開始更新他們的第三方應用程式並開始使用該服務。[4][5]後來,OS X 10.8("Mountain Lion")通過引入通知中心得到了改進。與 iOS 5.0 一樣,這一改進允許用戶在一個位置管理和閱讀收到的通知。[6][7]OS X 10.9("Mavericks")版本包含 Safari 7.0,該版本增加了對接受和接收來自用戶授權網站的 APNs 通知的支援。[8][9]

2023年12月,有關通過 APNs 傳送推播通知的潛在私隱和監視漏洞引起了關注。美國參議員羅恩·懷登在致司法部的一封信中透露,美國政府和外國執法部門都可能要求蘋果公司提供與推播通知相關的用戶數據。 [10]

技術細節

通過二進制介面傳送通知的有效載荷在2014年從256位元組增加到2千位元組。2015年12月,蘋果發佈了一個新的HTTP/2 API,取代了原先的二進制介面。使用HTTP/2 API傳送通知的最大有效載荷為4千位元組。[11]蘋果在2021年3月底關閉了原先的二進制介面。[12]

APNs 的HTTP/2介面使用了TCP 443埠作為主要通訊埠。當443介面的外向訪問被防火牆阻斷,開發者也可以使用TCP 2197埠代替。[13]

參見

參考資料

  1. ^ iPhone push notification service for devs announced. Engadget. June 9, 2008 [2023-07-06] (美國英語). 
  2. ^ Apple Push Notification Service. Apple Inc. March 21, 2016 [April 8, 2016]. 
  3. ^ iOS 5: Notifications and Notification Center. Gigaom. October 12, 2011 [April 8, 2016]. (原始內容存檔於October 4, 2016). 
  4. ^ OS X Lion v10.7. Apple Inc. December 8, 2015 [April 8, 2016]. 
  5. ^ Troubleshooting. Apple Inc. October 1, 2014 [April 8, 2016]. 
  6. ^ Apple Releases OS X Mountain Lion Developer Preview with Over 100 New Features. Apple Inc. February 16, 2012 [April 8, 2016]. 
  7. ^ OS X Mountain Lion features coming in iOS 6: Notification Center 'Do Not Disturb' toggle, Safari iCloud Tabs, and Mail VIPs. 9to5Mac. June 4, 2012 [April 8, 2016]. 
  8. ^ Safari 7.0 to bring web notifications to OS X Mavericks. Appleinsider. June 28, 2013 [April 8, 2016]. 
  9. ^ Now websites can send push notifications — not just apps. Niemanlab. June 10, 2013 [April 8, 2016]. 
  10. ^ Couts, Andrew. Police Can Spy on Your iOS and Android Push Notifications. Wired. [5 April 2024]. 
  11. ^ Local and Remote Notification Programming Guide: Creating the Remote Notification Payload. Apple Inc. October 24, 2016 [November 29, 2016]. (原始內容存檔於2018-06-01). 
  12. ^ Updated APNs provider API deadline - Latest News - Apple Developer. developer.apple.com. [2022-12-08]. (原始內容存檔於2023-04-16) (英語). 
  13. ^ Apple Developer Documentation. developer.apple.com. [2022-12-08]. (原始內容存檔於2023-05-20). 

外部連結