Still can't filter events based on ANCS attribute data!

I posted about this 3 weeks ago [1], but the title is a bit confusing, so I thought I should start a new thread with a proper title.

The event returned from this method never fires:







[device.ancs eventWithCategoryIds:MBLANCSCategoryIDAny

eventIds:MBLANCSEventIDNotificationAdded

eventFlags:MBLANCSEventFlagAny

attributeId:MBLANCSNotificationAttributeIDTitle

attributeData:self.name

identifier:self.identifier];


However, this code works fine:


[device.ancs eventWithCategoryIds:MBLANCSCategoryIDAny 

eventIds:MBLANCSEventIDNotificationAdded 

eventFlags:MBLANCSEventFlagAny i

dentifier:self.identifier];


The working code is of little use to me since I just want to make your sample app work. This comes pretty much directly out of the sample app. Please help.


Comments

  • Hi,

    We were actually discussing this issue with the team yesterday. We'll get back to you sometime next week with an update.

    Thanks for your patience!

    Yu
  • Great. Thanks!
  • Heath,

    If you could try a few things I think we can get to the bottom of this.

    First, my findings on iMessaging myself from my iPhone 6+.  If I start a new conversation using my phone number then messages sent are echo'd back in the same thread and no notification is generated.
    image

    If however, I send a message to my iMessage email address, then the messages are echo'd back in a different thread and a notification is generated.
    image
    Noting here the two threads, one with an unread notification.  If you get this, then great!


    Now lets focus on the simplest amount of code to prove its working.  For that, lets modify the base sample app (https://github.com/mbientlab/Metawear-SampleiOSApp).  I'll go ahead and just hijack the readTemperature button.
    image
    The attributeID should be MBLANCSNotificationAttributeIDTitle, and attributeData should be the name of the iMessage thread, in my case "Stephen", (note it may not be first and last name).


    Just to play it safe, reset the device before pressing Read Temperature.  Once you press Read Temperature the light may blink right away if you have unread notifications in the notification center (this is a good sign things are working).

    Now switch out of the app and send another message to yourself, your phone should buzz or beep or whatever happens when you normally get a text and the Metawear should flash read twice!

    If you get this working then we can go on to figure out the other issues.

  • Thanks for the feedback. I can't try it tonight, but I'll do it tomorrow and see how it works out.

    I'll create a project on github and post it here.
  • The results are the same as I've always had. I'm sending an SMS message from the hangouts app on my Nexus 5 to my iPhone 5S. It shows up in a thread labeled "Heath Borders". I've created a video to show you the entire process [1]. Also, I've uploaded my code to github [2]. I'm happy to help debug this any way I can.
  • Thanks for the willingness to help out, and great idea to shoot a video...I have a few more questions after watching.

    1. Just want to double check that you have the latest firmware on the MetaWear (0.9.0)
    2. What version of iOS do you have?
    3. Using ANCS requires the MetaWear "pair" with the iPhone, do you remember a dialog box popping up the first time you tried to use ANCS features?
    image
    I'm asking because if the device it paired, iOS should automatically connect in the background if the MetaWear is in range, but from the video I can see its not connected beforehand.

    4. Take a look at the Bluetooth menu in Settings, it should let you know if the device is paired...you will see it listed in My Devices
    image

    5. I would suggest only have one ANCS event active at a time, there are some known issues with multiple...use the first and last name since that is the thread title.

    6. One last experiment you could run would be to update the firmware again (to remove pairing information stored on the MetaWear) and forget the device on the iOS side (Settings -> Bluetooth -> (i) -> Forget This Device), then run the test app again (should see the Pairing Request popup show above).
  • I'll check all this stuff tonight. Thanks again for your help.
  • >1. Just want to double check that you have the latest firmware on the MetaWear (0.9.0)
    How do I tell what version I'm running? I ran "Check for firmware updates" on the code from my github repo, and it said I'm up to date.

    >2. What version of iOS do you have?
    I'm running iOS 8.1.2

    >3. Using ANCS requires the MetaWear "pair" with the iPhone, do you remember a dialog box popping up the first time you tried to use ANCS features?
    I remember seeing that come up the first time I connected. I unpaired the device on Settings->Bluetooth and when I pressed "Read Temperature", I saw that dialog again.

    >4. Take a look at the Bluetooth menu in Settings, it should let you know if the device is paired...you will see it listed in My Devices
    It is listed in "My Devices" as "Connected".

    >5. I would suggest only have one ANCS event active at a time, there are some known issues with multiple...use the first and last name since that is the thread title.
    I reverted to my first and last name as you suggested, and the results were the same.

    >6. One last experiment you could run would be to update the firmware again (to remove pairing information stored on the MetaWear) and forget the device on the iOS side (Settings -> Bluetooth -> (i) -> Forget This Device), then run the test app again (should see the Pairing Request popup show above).
    I did this, and the results were the same.

    I'm happy to make another video for you if you'd like. If there's a debug version of the firmware I can run that can dump log files for you, I'm happy to do it.
  • Thanks for the details response.

    So, last question before we will get together a firmware with more debug hooks.  If you set attributeId:MBLANCSNotificationAttributeIDNone and attributeData:nil will the light blink?
  • Yep. That works fine. I've posted a video demonstrating that complete interaction.


  • I found a tool that lets you view ANCS data on your mac.  Its a 2 part program, one that runs on iPhone and exposing the ANCS service, and another running on the mac which connects to the iPhone and reports notification data.  You can find it here: https://github.com/indragiek/INDANCSClient

    I just opened up the INDANCSClient.xcworkspace, from there you have a scheme for INDANCSiPhone and INDANCSMac.  There was a little tweaking to get INDANCSMac to build.  First, you have to clone https://github.com/indragiek/ObjectiveKVDB and run "git submodule update --init", then drag ObjectiveKVDB.xcodeproj to the Frameworks folder of INDANCSClientFramework.

    Hopefully you will be able to use this to double check the title of the notifications coming across the wire.


  • Thanks. I'll give this a try!
  • edited July 2015
    We gave ANCS a thorough investigation over the past several weeks and discovered a few issues, both within our software and within the ANCS service itself (issues have been filed with Apple).  Everything has been fixed (or worked-around) as of now.

    Pull the latest sample app (https://github.com/mbientlab/Metawear-SampleiOSApp) and update your firmware, then delete your old ANCS app and pull the latest (https://github.com/mbientlab/ANCS) and try again.

    Looking forward to your feedback.


This discussion has been closed.