0

I'm trying to send data via BTLE to a peripheral device. Based on the content of a text message, the data being sent should be different.

For example:

  • If I send "foo" then it sends the image "1.png" to the device.
  • If I send "bar" then it should send another image.

So, If a text message is received by the phone with a specific content, can I parse/extract/filter the content of that message (in notification center) in some way?

1 Answers1

2

Yes - Check out the Apple ANCS documentation here. And answers to some common questions about working with ANCS: iOS 7 ANCS: Discovering the primary ANCS Service UUID and Bluetooth LE and ANCS in iOS

Unfortunately you can only extract information that the Notification Center provides - from the docs:

  • NotificationAttributeIDAppIdentifier
  • NotificationAttributeIDTitle
  • NotificationAttributeIDSubtitle
  • NotificationAttributeIDMessage
  • NotificationAttributeIDMessageSize
  • NotificationAttributeIDDate

So you wouldn't be able to grab an image out of ANCS - only the above information is available for now. There are other reserved NotificationAttributeId's though so it's possible that in the future Apple could provide images.

Community
  • 1
  • 1
Michael
  • 703
  • 1
  • 5
  • 11
  • I think it's rather unlikely they're going to add support to transfer images via BLE, considering it's made for just small amount of data, an MTU of just 158 Byte and their emphasis on saving energy in their docs. – Lasse Meyer Jul 08 '16 at 11:39