IOS CBPeripheral Services not updating

I am having some problems with CBPeripheral in which the services are updated: my physical device has a button that updates the advertising services, but my application still reads the old services in the didDiscoverServices delegate didDiscoverServices .

Although, when I discover a peripheral device in didDiscoverPeripheral , I see that the services there are updated.

If I run the application again, the old services are still there! It seems the only way to get my application to open new services is turning Bluetooth off and on again. Even uninstalling / reinstalling my application is not enough.

Does iOS support iOS services forever? Is there any way to reset / erase the cache?

+5
source share
1 answer

Have you tried this scanForPeripheralsWithServices:options: When you call the scanForPeripheralsWithServices:options: method of the scanForPeripheralsWithServices:options: class to detect remote peripherals that are advertising services, your central device uses its radio receiver to listen to the advertising devices, until you explicitly report it to stop

Link: Recommendations for interacting with a remote peripheral device

+1
source

Source: https://habr.com/ru/post/1236150/


All Articles