How do I fetch ANCS notification attribute values?

Is it possible to fetch the values of ANCS notification attributes within code running in a block for -[MBLEvent programCommandsToRunOnEvent:]?

Is it even possible to dump the values of ANCS notification attributes to the log? When I log my ANCS event data now, I don't see any attribute data on the event data.


  • Our iOS dev is out for the holidays but he will get back to you as soon as possible. I will post the ANCS sample App on Github today which should hopefully give you everything you need.

  • ok it is done.
  • iOS dev here, it's not currently possible to dump the raw notification attribute data.  As you might of seen, we do offer the ability to match a single notification attribute, but I can see how not having access to the data will make it difficult to know what to match.  

    Our first target use case is matching a notification from a specific contact.   This is accomplished by matching the contacts name to the Title attribute.  If you have a different use case in mind, please let me know and I'll help you figure out what to match.

  • That's all I wanted to do. I'd love to see a matrix of what the notification attributes contain from different apps (iMessage, Mail, Facebook, Twitter, etc)
  • I just pulled the ANCS sample code, and it looks like a great start.

    When I run the ANCS sample code, I see my LED flashing in response to an initial connection to the device, but my LED never flashes when I receive a text message.

    I also added other buttons to the ANCS sample code, and I can flash other arbitrary colors to MetaWear.

    I removed the title event filter (so that I would flash the LED whenever I received any event), and changed the LED to always flash green (for some reason leaving a user-specified color on the LED doesn't ever show a color in an event callback) and the LED will flash as expected. However, the LED seems to flash when the -[MBLLED flashLEDColor:withIntensity:numberOfFlashes:] is called within my -[MBLEvent programCommandsToRunOnEvent:] callback.

    There is an additional bug where commands run in the programCommandsToRunOnEvent actually run on device when programming.

    I'm not very good at soldering, so I haven't attached anything to my MetaWear yet. I just have it connected via micro USB. Is it possible that some of these bugs are related to my not attaching a battery?
  • I won't speak to the issues related to the ANCS API, but the battery MUST be attached in order for the LED to work properly. Sometimes, the LED may work off the micro USB alone, but that is not a supported mode since the micro usb doesn't deliver enough current.
  • I've attached the battery, and my LED now flashes with arbitrary colors, but I still can't filter based on any attribute data yet. What iOS devices was this functionality tested with? I can test on an iPhone 4S, 5S, and 6.
  • It was tested on iOS 8.1 with an iphone 5, 6, and 6 plus. However, our in-house testing was rudimentary for this initial release. We'll look into it.
  • Do you have any update on this?

    It's pretty frustrating since ANCS is the whole reason I bought a MetaWear.
This discussion has been closed.