Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  2. {
  3.  
  4. NSArray *peripheralManagerIdentifiers = launchOptions[UIApplicationLaunchOptionsBluetoothPeripheralsKey];
  5.  
  6. if (peripheralManagerIdentifiers) {
  7.  
  8. // We've restored, so create the _manager on the main queue
  9. _manager = [[CBPeripheralManager alloc] initWithDelegate:self
  10. queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
  11. options:@{CBPeripheralManagerOptionRestoreIdentifierKey:@"YourUniqueIdentifier"}];
  12.  
  13. } else {
  14.  
  15. // Not restored so just create as normal
  16. manager = [[CBPeripheralManager alloc] initWithDelegate:self
  17. queue:nil
  18. options:@{CBPeripheralManagerOptionRestoreIdentifierKey:@"YourUniqueIdentifier"}];
  19.  
  20. }
  21. return YES;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement