backendless.messaging.registerDeviceToken

I have copy pasted the code from another application of mine. On the other one everything is working fine. Only difference is, I have updated to the latest Xcode release.

 func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
 print("token: \(deviceToken)")
 


 // prepare the token to be saved from <xxxxxxxx xxxxxxxx...> to xxxxxxxxxxxxxxxxx...
 var token = NSString(format: "%@", deviceToken)
 token = token.stringByReplacingOccurrencesOfString(
 "<",
 withString: "")
 token = token.stringByReplacingOccurrencesOfString(
 ">",
 withString: "")
 token = token.stringByReplacingOccurrencesOfString(" ", withString: "")
 


 print(token)
 


 if Reachability.isConnectedToNetwork() == true {
 backendless.messaging.registerDeviceToken(token as String)
 }
 }

Bildschirmfoto 2016-03-26 um 15.45.37.png

If I delete the line: “backendless.messaging.registerDeviceToken(token as String)”, the App has no problems. In the screens you can see the error and the log.

solved. I had an outdated SDK within the app. using cocoapods with the latest SDK solved the issue