Saturday, September 24, 2022
HomeiOS Developmentios - launchOptions: ? is all the time nil

ios – launchOptions: [UIApplication.LaunchOptionsKey: Any]? is all the time nil

after I go to get the “bluetoothCentrals” it’s all the time returned “nil”

The aim of this utility is to make sure that a ble machine is related as soon as when the appliance is began and that when the appliance is killed the connection stays energetic, in order that after I go to press a button within the bluetooth machine, the appliance is reopened to make an api name

inside func utility(
   _ utility: UIApplication, 
   didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
   guard let choices = launchOptions,
         let bluetoothCentrals = choices[UIApplication.LaunchOptionsKey.bluetoothCentrals] as? [String]
   else {
      return true

   print(bluetoothCentrals) // return all the time nil
   return true
centralManager = CBCentralManager(
   delegate: self, 
   queue: nil, 
   choices:[CBCentralManagerOptionRestoreIdentifierKey: "centralManager"]



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments