As far as I know, iOS devices use Random Resolvable MAC address, so we cannot apply variant based on MAC address directly.
So my suggestive method should be: put an ID on "Local name" field on advertisement data of iOS/Android app (iOS/Android device acts as peripheral), Central device will scan and filter based on retrieved advertisement data. This works unless app is in background only for iOS.
On iOS, apps simply cannot send out standard Bluetooth LE advertisements when they are in the background. They have to be in the foreground to do this
That said, there is limited support in iOS for apps advertising GATT Services in the background. This uses a proprietary technique that only works with other iOS devices that are looking for those services. (Because it uses a non-standard proprietary scheme, the same technique won't work for beacon advertisements, for example.)
Here's how Apple describes it:
..You should be aware that advertising while your app is in the background operates differently than when your app is in the foreground.
Based on that what we can do is continue BLE scanning & advertising in the background using service UUID. Then we have to scan for specific service UUID by using below method to scan in the background:
open func scanForPeripherals(withServices serviceUUIDs: [CBUUID]?, options: [String : Any]? = nil)
Another thing you need to set background mode in your .plist file. Set 'Required background modes' as 'App communicates using CoreBluetooth'.