                 }
             }
         } else {
-            // Fallback on earlier versions
+            UIApplication.shared.registerUserNotificationSettings(UIUserNotificationSettings(types: [.sound, .alert, .badge], categories: nil))
+            UIApplication.shared.registerForRemoteNotifications()
         }
         
     }

        // register PushNotifications
        self.registerPushNotifications()

        // init background Timer
        let interval = BreinifyManager.sharedInstance.backGroundTimeInterval
        updateTimer = Timer.scheduledTimer(timeInterval: interval, target: self,
                                           selector: #selector(sendLocationInformation), userInfo: nil, repeats: true)
    }


    // This method allows you to perform any final initialization before the app
    // is displayed to the user
    public func didFinishLaunchingWithOptions(apiKey: String, secret: String, backgroundInterval: Double?) {

        // configure the API key
        self.configure(apiKey: apiKey, secret: secret)
