Top Banner
A Quick look at ANCS (Apple Notification Center Service) Johnny Sung
34

A Quick look at ANCS (Apple Notification Center Service)

Jul 28, 2015

Download

Technology

Johnny Sung
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A Quick look at ANCS (Apple Notification Center Service)

A Quick look at ANCS(Apple Notification Center Service)

Johnny Sung

Page 2: A Quick look at ANCS (Apple Notification Center Service)
Page 3: A Quick look at ANCS (Apple Notification Center Service)

How about

?

Page 4: A Quick look at ANCS (Apple Notification Center Service)
Page 5: A Quick look at ANCS (Apple Notification Center Service)

不只 AndroidWear 其他 BLE 開發版也可以做

Page 6: A Quick look at ANCS (Apple Notification Center Service)

其實不只AndroidWear 其他BLE開發版也可以做

http://lukeberndt.com/wp-content/uploads/2014/09/ancs-1024x641.jpg

Page 7: A Quick look at ANCS (Apple Notification Center Service)

ANCS

Page 8: A Quick look at ANCS (Apple Notification Center Service)

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.

Page 9: A Quick look at ANCS (Apple Notification Center Service)

BLE

Page 10: A Quick look at ANCS (Apple Notification Center Service)

BLE 的⾓角⾊色

Page 11: A Quick look at ANCS (Apple Notification Center Service)

以 ANCS 為例

AndroidWear iPhone

Notification Consumer (NC)

Notification Provider (NP)

Page 12: A Quick look at ANCS (Apple Notification Center Service)
Page 13: A Quick look at ANCS (Apple Notification Center Service)

ANCS Service7905F431-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)

Page 14: A Quick look at ANCS (Apple Notification Center Service)

Register Flow

Page 15: A Quick look at ANCS (Apple Notification Center Service)

Notification Source 回傳封包

Page 16: A Quick look at ANCS (Apple Notification Center Service)

• Notification Added = 0 • Notification Modified = 1 • Notification Removed = 2

EventIDNotification Source

Page 17: A Quick look at ANCS (Apple Notification Center Service)

• Other = 0 • IncomingCall = 1 • MissedCall = 2 • Voicemail = 3 • Social = 4 • Schedule = 5 • Email = 6 • News = 7 • HealthAndFitness = 8 • BusinessAndFinance = 9 • Location = 10 • Entertainment = 11

CategoryIDNotification Source

Page 18: A Quick look at ANCS (Apple Notification Center Service)

http://l8smartlight.com/

Page 19: A Quick look at ANCS (Apple Notification Center Service)

https://www.youtube.com/watch?v=is8KMmE5030https://www.youtube.com/watch?v=GV21uziG_OM

Page 20: A Quick look at ANCS (Apple Notification Center Service)
Page 21: A Quick look at ANCS (Apple Notification Center Service)
Page 22: A Quick look at ANCS (Apple Notification Center Service)

傳送

接收

0

0

Page 23: A Quick look at ANCS (Apple Notification Center Service)

傳送

AttributeID

• AppIdentifier = 0 • Title = 1 • Subtitle = 2 • Message = 3 • MessageSize = 4 • Date = 5

0

Page 24: A Quick look at ANCS (Apple Notification Center Service)

接收

• 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

Page 25: A Quick look at ANCS (Apple Notification Center Service)

範例Request AttributeID

• AppIdentifier = 0 • Title = 1 • Subtitle = 2 • Message = 3 • MessageSize = 4 • Date = 5

"com.JohnnyWorks.SHRS-Radio"

"⺟母親像⽉月亮⼀一樣~古典逍遙遊祝全天下的媽媽,⺟母親節快樂!"

"世新廣播電臺"

"20150510T100002"

nil

28

Response

Page 26: A Quick look at ANCS (Apple Notification Center Service)
Page 27: A Quick look at ANCS (Apple Notification Center Service)

App Identifier = "com.apple.AppStore"

傳送

接收

AttributeID

• DisplayName = 01

1

Attribute Value = "App Store"

App Identifier = "com.apple.AppStore"

0

0

Attribute Length = 9

AttributeID = 0

AttributeID = 0

Page 28: A Quick look at ANCS (Apple Notification Center Service)

ANCS 注意事項• 字串資料都會以 UTF-8 的編碼傳遞

• 數值資料都會以 Little-endian 的⽅方式傳遞

Page 29: A Quick look at ANCS (Apple Notification Center Service)

MessageHorn

Page 30: A Quick look at ANCS (Apple Notification Center Service)
Page 31: A Quick look at ANCS (Apple Notification Center Service)
Page 32: A Quick look at ANCS (Apple Notification Center Service)

AndroidWear

Page 33: A Quick look at ANCS (Apple Notification Center Service)

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

Page 34: A Quick look at ANCS (Apple Notification Center Service)

https://www.facebook.com/groups/353660298163446/

穿戴式裝置開發者社群

歡迎您的加⼊入