azure-notificationhubs IOS Bad request - azure

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

Related

Dynamics 365 Marketing push notification not sending

We are trying to implement Push Notifications for Dynamics 365 marketing. Using the documentation from Microsoft Create push notifications
My Android studio successfully receive test notifications from Firebase in my emulator we well as on my Android Phone.
Device FcmToken and ApiToken sent successfully to D365. Like in this article Device registration for Android applications
D365 say its got a valid connection to my app as well as found my device. I can also see my mobile devices was registered with the correct Contact id.
I configured then a push and using the "Test Send" and selecting the app and the contact I receive a screen pop-up "Test message has been sent successfully"
However I never receive the notification on the device.
Firebase test messages works perfectly.
Hope someone can help me in pointing out what I'm missing.
Thanks in advance.

Azure Push Notification Service for Apple iOS 13 fails

We are able to send push notification to apple 12.x iOS devices. But it doesn't send notification to the iOS 13 devices. We tried the suggestion of adding "apns-push-type" value to "alert" in the notification header. But it doesn't work at all. It seems microsoft doesn't know how to fix it. They just like that told the change. We have tried many ways to solve it for last 1 week. But no success.
Apple recently updated their public Push service in a way that impacts Azure Notification Hubs customers. Learn more about the impact of these changes on Azure Notification Hubs. Specifically, Apple now requires that developers identify notifications as an alert or background notifications through the new 'apns-push-type' header in the APNS API.
Azure Notification Hubs updates for iOS 13 - I understand you mentioned "We have tried many ways to solve it", If you haven't tried these already kindly try and let us know for further investigation.
According to Apple’s documentation: "The value of this header must accurately reflect the contents of your notification’s payload. If there is a mismatch, or if the header is missing on required systems, APNs may return an error, delay the delivery of the notification, or drop it altogether."
Developers must now set this header in their applications that send notifications through Azure Notification Hubs. Due to a technical limitation, customers must use token-based authentication for APNS credentials with requests that includes this attribute. If you’re using certificate-based authentication for your APNS credentials, you must switch to using token-based authentication.
To help you during this transition, when Azure Notification Hubs detects a notification that doesn’t have the apns-push-type set, the service will infer the push type from the notification request and set the value automatically. Remember, you must configure Azure Notification Hubs to use token-based authentication to set the required header; please refer to Token-based (HTTP/2) Authentication for APNS for additional information.
Another minor change, but one that requires a change to the backend application that sends notifications, is the requirement that for background notifications the apns-priority header must be set to 5. Many applications set the apns-priority header to 10 (indicating immediate delivery), or don’t set it and get the default value which is also 10. This is no longer allowed for background notifications, so you must set the value for each request as Apple will not deliver background notifications if this value is missing.
For years, iOS developers used the description attribute of the deviceToken data sent to the push token delegate to extract the push token a backend application uses to send notifications to the device. With Xcode 11, that description attribute changed to a different format. Existing code developers used for this is now broken. We’ve updated the Azure Notification Hubs SDK to accommodate this change, please update the SDK used by your applications to the version 2.0.4 or newer of the Azure Notification Hubs iOS SDK.
Source -Azure Updates Azure Notification Hubs updates for iOS 13 (Posted on 21 October 2019). Copied the content here for more clarity.

Payload for sending push notifications to Windows 10 (mobile) devices with Azure notifcation hub

What is the payload to send push notification to Windows 10 (mobile) devices without showing a message to the user (silent push)? All i need to deliver within the push is a custom parameter.
Check out whether X-WNS-SuppressPopup header in Push notification service request and response headers works for you:
X-WNS-SuppressPopup
For Windows Phone Store apps, you have the
option to suppress a toast notification's UI, instead sending the
notification directly to the action center. This lets your
notification be delivered silently, a potentially superior option for
less urgent notifications. This header is optional and only used on
Windows Phone channels. If you include this header on a Windows
channel, your notification will be dropped and you will receive an
error response from WNS.

Azure NotificationHub Invalid credentials when sending push

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

Azure Notification Hub: How to view per message telemetry?

On the pricing page for Azure Notification Hubs:
https://azure.microsoft.com/en-us/pricing/details/notification-hubs/
It states that "Standard namespaces have access to Per Message Telemetry and Push Notification Services Feedback". I am using a Standard namespace.
The app is sending template based notifications to an iOS app from my back end using the C# Notification Hub client. For example:
NotificationOutcome result = await hub.SendTemplateNotificationAsync(params, tags);
The result.State is coming back as Enqueued, but some notifications are not being delivered and I am trying to figure out why. (There are no bad registrations in the hub - I have already checked that.)
In the Azure portal, I can see aggregate metrics of messages received by the hub, errors, etc. - but I cannot seem to view the specific results of a push message to determine why it failed to reach the device, or even if it was successfully handed off to APNS.
How can I see the results of an attempted push? Is this even possible with Azure Notification Hubs?
Did you try Fiddler+https://msdn.microsoft.com/en-us/library/azure/mt608135.aspx ?
Also, as far as i know, Apple does not guarantee the delivery of all notifications.
1) Is Apple's push notification service reliable?
More of that,
2) https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-faq/
"A PNS does not guarantee any SLA for delivering notifications; however, typically a vast majority of push notifications are delivered to target devices within a few minutes (usually within the limits of 10 minutes) from the time they are sent to our platform. "

Resources