i'm using azure mobile service to send push notification.In Last month,I can send push notification.
but yesterday, sending to apns is failed with following log
[Error: wrong tag] scheduler/expectationNotification
I've never seen this before, and a Bing/Google search comes up with nothing.
I using two azure mobile service. One is no problem,but the other is failed.
What do not people more about this issue?
You should reload your APNS certificate in the portal and the problem should go away.
Related
I've set up an Azure Notification Hub and I have gone through all the steps to implement Push Notification into my iOS app. The app has been working fine, receiving the push notifications just like it should. Then today I went to try and send a push from the Azure Portal and it failed.
It seems to be only iOS related though, as the devices that run my app in Android are receiving the Push Notification like they should. I know for a fact I have not changed anything in my code. But instead of getting the Push Notification like I should I now get the following message in Azure portal.
The Push Notification System rejected the request because of an
Invalid Credential.
Any idea about this?
I have just resolved this issue. Just create new APNS certificates and add it to Azure Portal APNS settings. Now it works fine. But Why this is happened I don't understand that. If anyone have idea regarding this then please share it.
If any other solution then please share it here.
Thanks.
This is a potential explanation to your problem.
When you configure APNS into an ANH (Azure Notification Hub), you have the choice between 2 approaches:
Certificate
Token
Of what I understood, you have used "certificate", and APNS certificate expires every year:
https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_certificate-based_connection_to_apns
So maybe, your certificate has expired, and when you created a new one, it has solved your issue.
The other approach with "Token", has the advantage of never expiring.
Regards,
Loic
I'm trying to update the existing APNS Credential for my Azure notification hub.
Regardless if I try to upload a new certificate or click "Delete Credential" I get the same error:
Error updating notification hub
{"error":{"message":"Object reference
not set to an instance of an object.","code":"InternalServerError"}}
If I check the developer console in the browser, there's a PATCH request made, where the only parameter is pnsCredential: null.
I've tried multiple browsers and computers with same results.
Thank you for your edit, it is correct: this was a transient issue in the Notification Hubs creation. This is now resolved and we are not expecting that specific issue to happen again.
Thanks, Karl
Updating for anyone else who may find this.
This seems to have been an issue on Azure Portal. It has since been resolved and now works as expected, without any further action on my end.
I did report it to #AzureSupport but have not heard of any action taken by them, so not sure if that is why it was resolved.
I send notifications to mobile platforms via Azure portal. There is no problem on Windows and Android platforms, but I can not send 4 days notice to the IOS platform and I get this error
According to your description, I have tested sending test messages to my mobile platform on Azure portal, I have configured Notification Services for Windows (WNS), then I could send test message successfully to my UWP app. While sending a message to Apple platform, then I could encounter the same error as follows:
Since the error is too broad, then I leverage Notification Hub sdk to send a message to Apple platform as follows:
hub.SendAppleNativeNotification(
"{ \"aps\": { \"alert\": \"This is my alert message for iOS!\"}}");
Error
In summary, please make sure you have correctly configured the Notification Services for Apple (APNS) and the notification payload format is correct.
Azure notification hub uses 1 year of apple certification. Since this time has passed, I am getting a bad request error, I wish it was somewhere, certifications have been renewed and the problem is solved
First, I should clarify that I'm only using free modules and service plans on the Azure side, using a Bizspark subscription.
I'm currently trying to run the app in the following tutorial:
https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-push
Everything works on the client side, items are correctly sent and stored in the database. However, I can't make the NodeJS server send push notifications to devices.
I basically copy and pasted the code on the tutorial for the nodeJS back-end on the tutorial, redeployed/restarted the server, but not a single push notification is sent.
I tried to see where in the code something was wrong, so I went and used some logger.info here and there. I then found out that context.push is undefined.
However, I did connect the mobile app to the notification hub in the "push" category in the menu of my mobile-app in Azure (it does appear connected).
Push page on my mobile app
Google cloud messaging is also correctly configured, I get the push notification for the successful registration when I start the app.
What am I missing? Is it because I'm using free plans (notification hub, database, service plan)?
First of all, you could test sending notifications via the Azure portal, to do this, please see steps below.
Go to the Azure portal and navigate to your notification hub.
Click on Test Send under the SUPPORT + TROUBLESHOOTING menu.
Select the platform you used, then fill payload message and click Send button.
Almost immediately (but in reality, it could be a few minutes because of PNS delays), you will see the push notification alert on your application.
For node.js backend on Azure mobile apps, you could use the following lines of code to send a push notification to all registered clients.
var payload = {
data: {
message: 'Hello!'
}
};
notificationHubService.gcm.send(null, payload, function(error){
if(!error){
//notification sent
}
});
For more info, please check out this tutorial.
I did try the test send a few times and it worked perfectly, hence why I couldn't understand how it couldn't work. I couldn't use the exact same code #aaron-chen-msft posted as I use the basic back-end nodeJS server on Azure (the quickstart one, so I would need to install the "azure" npm package), but I added the following string to my mobile app settings (application settings tab) on azure:
key : MS_NotificationHubName value : MyNotificationHubName (here, Poke-Forgh)
Context.push was then not undefined, but the notifications weren't sent, so I got inspired by #aaron-chen-msft's code and I edited the nodeJS code to specifically send notifications to GCM:
context.push.gcm.send(null, payload, function (error) { ... }
And it finally worked. Thanks!
I've set up an Azure Notification Hub and I have gone through all the steps to incorporate Push Notification into my Android app. The app has been working fine, receiving the push notifications just like it should. Then today I went to try and send a push and it failed. So I tried from the Azure Portal and it failed there too.
It seems to be only Android related though, as the devices that run my app in iOS are receiving the Push Notification like they should. I know for a fact I have not changed anything in my code. But instead of getting the Push Notification like I should I now get the following message in Azure portal.
The Push Notification System rejected the request because of an invalid credential
Does anyone have any idea why this would happen? I'm stumped.
I thought at first maybe it was something with my API key (which again I have not changed) so I checked. The Google Cloud Message API Key in the Azure Portal matches what I have in my Google API Console, so it's not that.
What could it be?
Ok, so here is how I fixed my issue:
In Google API Manager I used to only have an api key of type - Android
I created another key of type - Server, and copied that into my azure gcm config, and away she goes... notifications working again