0

I am able to get a list of CBPeripheral devices in following delegate method.

- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary<NSString *, id> *)advertisementData RSSI:(NSNumber *)RSSI {
   ...
}

Now, I am keeping reference to the connected CBPeripheral by creating a strong property for it.

Later time, if I want to access the advertisementData which I received in above delegate, can I get it again from the reference of peripheral I kept previously.

Hemang
  • 26,840
  • 19
  • 119
  • 186

1 Answers1

0

You will also need to keep a reference to the advertisementData for each peripheral that the CBCentralManager discovers.

Aris
  • 1,529
  • 9
  • 17
  • So this is the only way I can achieve this? – Hemang Dec 16 '16 at 04:53
  • Yes, I don't see in the documentation any other place that the advertisemantData might be. I would suggest creating a object that holds the CBPeripheral and and the corresponding advertisementData and use that for everything. – Aris Dec 16 '16 at 07:29
  • are you available for online support? I am ready to make payment if you can support me for my on-going project. I stuck in middle of something. If you are available for ~2 hours, you can reach me out inside my SO profile. You can find my email over there. – Hemang Dec 16 '16 at 11:16