This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

About ble_ancs_c

Hi all, I have some question with ble_ancs_c sample code.

SoftDevice: nRF51822 S110 V8.0.0

SDK: nRF51_SDK_9.0.0_2e23562


I add ble_ancs_c_request_attrs function in on_ancs_c_evt evt_handler's BLE_ANCS_C_EVT_DISCOVER_COMPLETE and BLE_ANCS_C_EVT_NOTIF case in order to retrieve all notification' attributes.

When new notification appears, I can retrieve its attributes(App Identifier, Title, Subtitle, Message, Message Size, Date, Positive Action Label, Negative Action Label).

After BT connection with iOS, I receive all the old notification's BLE_ANCS_C_EVT_NOTIF event, but only retrieve one old notification's attributes.

Q1. How to retrieve all the old notification's attributes?

If I make notification read in iOS device, I can retrieve the removed notification, but can not retrieve it's notification's attributes. I want to distinguish between different "Social" notification (ex: LINE, Facebook...etc) which I have read in iOS device.

Q2. How to retrieve the removed notification's attributes?

When new notification appears, I can retrieve its all attributes. But if there comes too many new notification in short time, it can not retrieve all the new notification attributes.

Q3. How to make sure retrieve all the new notification's attributes in short time?

Thanks!

Parents
  • Hey.

    In general, the iOS device will only send you the notification update, and you must request the attributes. This is to not send data unnecessary over the BLE link.

    1. You must request all the attributes manually after a disconnect. alternatively, you can store them locally on your device. They will have the same unique notification ID. When you receive a "removed" event, you can see in your stored notification what kind of notification it was.

    2. I believe that these attributes are no longer available, since they have been removed from the iOS notification center.

    3. You will have to do one at a time, but you should no "lose" any data. How does this happen? Are you able to send the request, but no data comes from the iOS device? Is this happening right after you connect to the iOS device, or when you are already connected nad the iOS device receives a lot of notification at the same time?

    If you havent read it, here is Apple's ANCS documentation.

    Best regards Anders

Reply
  • Hey.

    In general, the iOS device will only send you the notification update, and you must request the attributes. This is to not send data unnecessary over the BLE link.

    1. You must request all the attributes manually after a disconnect. alternatively, you can store them locally on your device. They will have the same unique notification ID. When you receive a "removed" event, you can see in your stored notification what kind of notification it was.

    2. I believe that these attributes are no longer available, since they have been removed from the iOS notification center.

    3. You will have to do one at a time, but you should no "lose" any data. How does this happen? Are you able to send the request, but no data comes from the iOS device? Is this happening right after you connect to the iOS device, or when you are already connected nad the iOS device receives a lot of notification at the same time?

    If you havent read it, here is Apple's ANCS documentation.

    Best regards Anders

Children
Related