Store the connected CBPeripheral instance and retrieve it in Xamarin.iOS

JJBHATTJJBHATT INMember ✭✭

While discovering available devices I use to get the List of CBPeripheral devices. Based on this list, I allow the user to select and connect to device. It gets connected successfully. But now I want that once device gets paired and connected it should try to auto-connect. For that I am trying to cast a model that include CBPeripheral property and convert it to Json and store in one file and retrieve on auto-connect. But unfortunately UUID property of CBPeripherals internally throws exception due to which I am not able to cast my model to JsonString.

Does any one has clue how can I get rid of this?

P.S. - I need to use UUID since its deprecated and I am using identifier but I want that particular CBPeripheral instance for future use so I need to convert CBPeripheral instance to JSONString and on auto-connect retrieve and convert it back to CBPeripheral object. And I am getting objective-c exception during that conversion because of UUID internally throws eexception.

Sign In or Register to comment.