I'm using the new push-notification service on bluemix, with an iOS device.
The device registers successfully. When I check with the REST-API, I see the device-ID, token and so on.
However, running the iOS-app on the device crashes the app on first run and registration.
The crash happens in CDVMFPPush.swift in func didRegisterForRemoteNotifications(deviceToken: NSData)
on line 309 (let pushToken = response.responseJson["token"] as! String).
I did a print(response) in this function and it seems that responseJson only contains the deviceId and the userId. The token is missing.
When I use the REST-Api again to do the same request, the response seems to be complete.
I think that because of this error the push registration doesn't finish, as I don't receive any notifications when I try to run the service in sandbox-mode.
Any ideas?
(P.S. I checked this solution - iOS Application crashes when trying to register the device to IBM Mobile First Push service on Bluemix - the linker flag is set [-ObjC])
Here's the request from my console (app-id/secret/device is edited)
Response text: {"createdTime":"2016-06-07T15:28:55Z","lastUpdatedTime":"2016-06-07T15:28:55Z","createdMode":"API","deviceId":"xxxx","userId":"","token":"xxxx","platform":"A","href":"https://myapp.mybluemix.net:443/imfpush/v1/apps/xxxx/devices/xxxx"}
httpStatus: 201
responseHeaders: {
Connection = "Keep-Alive";
"Content-Type" = "application/json";
Date = "Tue, 07 Jun 2016 15:28:55 GMT";
Location = "https://myapp.mybluemix.net:443/imfpush/v1/apps/xxxx/devices/xxxx";
"Transfer-Encoding" = Identity;
"X-Backside-Transport" = "OK OK";
"X-Global-Transaction-ID" = xxxx;
"X-Powered-By" = "Servlet/3.0";
}
responseJson: {
deviceId = "xxxxx";
userId = "";
}