Last active
April 17, 2020 04:12
-
-
Save charlesmuchene/71d99f672a67ba2ef52cf542767bc4a9 to your computer and use it in GitHub Desktop.
iOS as Central - peripheral delegate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implement peripheral callback methods | |
extension SocialService: CBPeripheralDelegate { | |
func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) { | |
// Discover characteristics | |
} | |
func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) { | |
// Request for TraceCharacteristic value -- TraceToken | |
} | |
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { | |
// Voila! Trace Token received | |
// Do amazing things with it | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment