In my iOS app I'm trying to add push notifications via Azure Mobile Services.
I have followed this article: https://azure.microsoft.com/en-us/documentation/articles/mobile-services-javascript-backend-ios-get-started-push/
But my app still receive no push notifications!
In the iOS dev center I registered App ID with Dev and Production push certificates.
Added Dev certificate (.p12) to Sandbox in the Azure.
I wrote POST function
exports.post = function(request, response) {
var text = 'You\'ve just received a push!';
var push = request.service.push;
push.apns.send(null, {
alert: "Alert",
payload: {
inAppMessage: text
}
}, {
success: function(pushResponse) {
console.log("Sent iOS push:", pushResponse);
response.send(statusCodes.OK, { message : 'Push send success' });
}, error: function(error) {
console.log("Sent iOS push error:", error);
response.send(statusCodes.BAD_REQUEST, { message : 'Push send error: ' + error });
}
});
};
In the log I'm getting this everytime:
Sent iOS push: { isSuccessful: true,
statusCode: 201,
body: '',
headers:
{ 'transfer-encoding': 'chunked',
'content-type': 'application/xml; charset=utf-8',
server: 'Microsoft-HTTPAPI/2.0',
date: 'Sat, 02 Apr 2016 18:27:42 GMT' },
md5: undefined }
Also, in the app I register for push:
if let client = self.azureClient {
client.push.registerNativeWithDeviceToken(deviceToken, tags: nil, completion: { (error: NSError?) in
if let error = error {
print(error)
}
})
}
I'm stuck and don't know what to do to make Azure send pushes to my app.
It would be great if anyone could explain me what I'm doing wrong.
Thanks!
UPDATED
I've just found that in Notification Hub Debug tab when I try to broadcast push it shows that there is no registrations: Despite the fact that Notification Hub Monitor shows, that there was some Registration Operations and Incoming Messages: