Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Quick look at ANCS (Apple Notification Center...

A Quick look at ANCS (Apple Notification Center Service)

快速看懂 ANCS 文件

Johnny Sung

May 13, 2015
Tweet

More Decks by Johnny Sung

Other Decks in Programming

Transcript

  1. ANCS = Apple Notification Center Service ANCS is to give

    Bluetooth accessories (that connect to iOS devices through a Bluetooth low-energy link) a simple and convenient way to access many kinds of notifications that are generated on iOS devices.
  2. ⟃"/$4捀⢿ ANCS Service 7905F431-B5CE-4E99-A40F-4B1E122D00D0 Notification Source Control Point Data Source

    9FBF120D-6301-42D9-8C58-25E699A21DBD 69D1D8F3-45E1-49A8-9821-9BBDFDAAD9D9 22EAC6E9-24D6-4BB5-BE44-B36ACE7C7BFB (writeable) (notifiable) (notifiable)
  3. • Notification Added = 0 • Notification Modified = 1

    • Notification Removed = 2 EventID Notification Source
  4. • Other = 0 • IncomingCall = 1 • MissedCall

    = 2 • Voicemail = 3 • Social = 4 • Schedule = 5 • Email = 6 • News = 7 • HealthAndFitness = 8 • BusinessAndFinance = 9 • Location = 10 • Entertainment = 11 CategoryID Notification Source
  5. 傳送 AttributeID • AppIdentifier = 0 • Title = 1

    • Subtitle = 2 • Message = 3 • MessageSize = 4 • Date = 5 0 叆鑉䲀久鎝䜂
  6. 接收 • AppIdentifier = 0 • Title = 1 •

    Subtitle = 2 • Message = 3 • MessageSize = 4 • Date = 5 "com.apple.AppStore" "已更新「Adobe Photoshop Mix」和其他 6 個應⽤用程式" "App Store" "20150324T225555" nil 36 AttributeID 0 叆鑉䲀久鎝䜂
  7. 範例 Request AttributeID • AppIdentifier = 0 • Title =

    1 • Subtitle = 2 • Message = 3 • MessageSize = 4 • Date = 5 "com.JohnnyWorks.SHRS-Radio" "⺟母親像⽉月亮⼀一樣~古典逍遙遊祝全天下的媽媽,⺟母親節快樂!" "世新廣播電臺" "20150510T100002" nil 28 Response 叆鑉䲀久鎝䜂
  8. App Identifier = "com.apple.AppStore" 叆鑉"QQそ珖 傳送 接收 AttributeID • DisplayName

    = 0 1 1 Attribute Value = "App Store" App Identifier = 
 "com.apple.AppStore" 0 0 Attribute Length = 9 AttributeID = 0 AttributeID = 0
  9. References • Apple Notification Center Service (ANCS) Specification • https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/

    AppleNotificationCenterServiceSpecification/Introduction/Introduction.html • Core Bluetooth Programming Guide • https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/ Conceptual/CoreBluetooth_concepts/AboutCoreBluetooth/Introduction.html • INDANCSClient • https://github.com/indragiek/INDANCSClient