         backgroundTask = UIApplication.shared.beginBackgroundTask { [weak self] in
             self?.endBackgroundTask()
         }
-        // assert(backgroundTask != UIBackgroundTaskInvalid)
     }
 
     func endBackgroundTask() {

        BreinLogger.shared.log("didReceiveRemoteNotification called with notification: \(notification)")

        let notDic = notification["aps"] as! [String: Any]
        self.sendActivity("receivedPushNotification", additionalContent: notDic)
    }

    public func didFailToRegisterForRemoteNotificationsWithError(_ error: Error) {


        let aps = notification.request.content.userInfo["aps"] as! [String: Any]

        self.sendActivity(BreinActivityType.OPEN_PUSH_NOTIFICATION.rawValue, additionalContent: aps)

        // call BreinNotification-Handler
        Breinify.getNotificationHandler()?.willPresent(notification)
