Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
- {
- NSArray *peripheralManagerIdentifiers = launchOptions[UIApplicationLaunchOptionsBluetoothPeripheralsKey];
- if (peripheralManagerIdentifiers) {
- // We've restored, so create the _manager on the main queue
- _manager = [[CBPeripheralManager alloc] initWithDelegate:self
- queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
- options:@{CBPeripheralManagerOptionRestoreIdentifierKey:@"YourUniqueIdentifier"}];
- } else {
- // Not restored so just create as normal
- manager = [[CBPeripheralManager alloc] initWithDelegate:self
- queue:nil
- options:@{CBPeripheralManagerOptionRestoreIdentifierKey:@"YourUniqueIdentifier"}];
- }
- return YES;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement