iOS BLE background scanning with dynamic UUID

Hello,


We have a device that sends bluetooth (GAP) advertisement broadcasts at unpredictable intervals. The advertisement information passed that is relevant to our issue is:

Advertisement name: (type GAP_ADTYPE_LOCAL_NAME_COMPLETE) is fixed between all of our advertisements, and we are treating this as a string that identifies messages as those belonging to our application.

UUID: We are dynamically changing the values here, and parsing those out on the client.

Desired behavior


We would like to scan for a device in the background based on its advertisement name, and then as a next step parse the UUID for embedded information.

Things tried


I was able to successfully pick up readings in the foreground with scanForPeripheralsWithServices. However, from what I have read, you need to supply a non-empty list of services to this method in order for it to run properly in the background. This requires you know the UUID of the device you are scanning for.

Here is a recent stackoverflow post that elaborates on what we have currently tried: https://stackoverflow.com/questions/48765739/bluetooth-le-ios-unable-to-scan-in-background/48772494?noredirect=1#comment84624199_48772494. From this, I have learned that scanForPeripheralsWithServices is likely not the way to go.

Questions


Is it possible to achieve our “desired behavior” given our current approach? Or will we need to modify how we are structuring our advertising data? If we do need to modify things, is there a way to do it on top of the broadcast layer only, or will we need to create a connection (central / peripheral relationship)?


We have the privilege to change the structure of the data sent from the peripheral also but this is a last resort. If the UUID has to be fixed for background scanning, how do we need to broadcast the embedded data so that it would make the iOS app capture it? (Currently, we send the name in the Scan Response Data and the embedded Data in the Advertisement data - in the iBeacon format).


** Sorry to have so many questions in this section. It's fine if not all of them are answered individually. I thought I'd post them just to share where the current points of confusion are and where this discussion thread might go to provide some clarity. Thank you! **

Replies

Have you find the solution..

My flow is, app should find the particular advertisiment data and show notification when app in background..

Is it possible using swift?