Search code examples
iosibm-cloudibm-mobile-services

How to configure Push Notification in Mobile App Buider?


I'm using a Mobile App Builder to make some prototype. One of them I need to send push notification. So, I created a App with App Builder and configure a push settings using Push Notification Services (App GUID and App Route).

After that, I was defined settings a Apple Certificate to send push (https://new-console.ng.bluemix.net/docs/services/mobilepush/t_push_provider_ios.html)

So, when I try to send push notification using Push Notification Services (Bluemix) I receive a msg: 1 - Internal server error. No devices found.

When I see a log in XCode I Found:

registerDeviceToken:completionHandler:]_block_invoke_2 in IMFPushClient.m:116 :: Response of device registration - Response is: httpStatus: 201
responseHeaders: {
    Connection = "Keep-Alive";
    "Content-Type" = "application/json";
    Date = "Thu, 12 May 2016 18:21:22 GMT";
    Location = "https://enviarpush.mybluemix.net:443/imfpush/v1/apps/428e6b13-2cc7-4f99-8d7e-9741d6742709/devices/AFAF9994-535D-4F6C-9789-317E680833A8";
    "Transfer-Encoding" = Identity;
    "X-Backside-Transport" = "OK OK";
    "X-Global-Transaction-ID" = 2301423703;
    "X-Powered-By" = "Servlet/3.0";
}
responseJson: {
    createdMode = API;
    createdTime = "2016-05-12T18:21:22Z";
    deviceId = "AFAF9994-535D-4F6C-9789-317E680833A8";
    href = "https://enviarpush.mybluemix.net:443/imfpush/v1/apps/428e6b13-2cc7-4f99-8d7e-9741d6742709/devices/AFAF9994-535D-4F6C-9789-317E680833A8";
    lastUpdatedTime = "2016-05-12T18:21:22Z";
    platform = A;
    token = 7574a3f1d14a7a01f8d43663cef686b3cb66a634b71ed20608a739c4f55356db;
    userId = "";
}
Response text: {"createdTime":"2016-05-12T18:21:22Z","lastUpdatedTime":"2016-05-12T18:21:22Z","createdMode":"API","deviceId":"AFAF9994-535D-4F6C-9789-317E680833A8","userId":"","token":"7574a3f1d14a7a01f8d43663cef686b3cb66a634b71ed20608a739c4f55356db","platform":"A","href":"https://enviarpush.mybluemix.net:443/imfpush/v1/apps/428e6b13-2cc7-4f99-8d7e-9741d6742709/devices/AFAF9994-535D-4F6C-9789-317E680833A8"}

This infos confirm that my device was register, I'm right?

Thanks


Solution

  • You have to register a device to the IBM Push Notifications Service in order for it to successfully receive push notifications. I would suggest looking at the following documentation:

    Enabling iOS applications to receive push notifications

    There is also a sample available that demonstrates these capabilities:

    HelloPush