Comments (7)
Hi @idevchris,
As you discovered, you can't set the apns-topic
directly because it is set automatically by the Hub (based on the App ID/Bundle ID that is configured).
Azure Notification Hubs does not provide official support for sending APNS VOIP notifications. It can be made to work, but there are some caveats:
- You can only set a single App ID/Bundle ID per Hub. In order to send standard and VOIP notifications, you need to use two different Hubs.
- You must set the
apns-push-type
header yourself. If you do not specify the header, then the Hub will attempt to infer the proper value based on the payload of the notification. The inference logic is intentionally simple, and will not attempt to infer thevoip
value. Specifying the header explicitly will override the inference logic. - The Hub will limit the size of the payload to 4KB (which is the limit for standard notifications as documented by Apple). There is no logic to allow for the larger 5KB payloads for VOIP notifications.
In summary, VOIP notifications are treated as a special case by APNS (use a special Bundle ID, use a special value for apns-push-type
, increase the payload size limit). It is possible to send VOIP notifications through Azure Notification Hubs, but you must do so in a particular way.
from azure-notificationhubs-dotnet.
Thank you for the detailed answer.
What is the best way to enter a feature request for this?
I would also love to see this information added to the official Microsoft Notification Hub documentation. We could have saved some days, if we would have known about this behavior of notification hub.
from azure-notificationhubs-dotnet.
You need to create separate notificationHubs for each of
bundleId
+sandbox
bundleId
+production
bundleId.voip
+sandbox
bundleId.voip
+production
You will need to acquire both PushKit and Classic notification tokens and register them with the appropriate hub.
The field bundleId
in the APNS settings maps directly onto the apns-topic
header and is fixed for a notification hub.
It is a bit of a PITA but that's the way Apple does it.
Be careful - notification hubs are broken in respect of VOIP
messages and sandbox
+ voip
seems to interfere with your messages - so make sure you add the apns-push-type : voip
header.
We have raised the broken sandbox
+ VOIP
issue with MS but they have just stated - "Well don't use VOIP then".
Be aware that the new IOS 13 rules make VOIP notifications a bit more tricky.
Don't expect test-send
to work on sandbox
+ voip
hubs in the near future.
In Summary
VOIP
messages are a bit off-piste ATM
- one hub per mode and bundle
mode | voip | classic |
---|---|---|
production | x | x |
sandbox | x | x |
- set
apns-push-type
yourself test-send
not currently working onsandbox
+voip
hubs
from azure-notificationhubs-dotnet.
@idevchris there is a feature request for this here:
https://feedback.azure.com/forums/218849-notification-hubs/suggestions/38507452-support-ios-voip-and-standard-notifications-in-one
I apologize for the confusion on this. We are working on updating the documentation to include the information I added above.
from azure-notificationhubs-dotnet.
@sadgit thanks for the additional info.
The Test Send functionality in the Portal is not meant to cover platform specific scenarios. For example, you also cannot set the expiry or priority of an APNS notification. It is meant for testing basic functionality of the Hub, e.g. testing you have the proper credentials configured. Test Send will not work for sending VOIP notifications, due to the requirement to explicitly set the apns-push-type
header.
It is possible to test platform specific functionality through one of our SDKs or by using the REST API directly. I'll look into improving our REST API documentation to include some basics on calling it interactively, using tools like Fiddler, Postman, curl, etc.
from azure-notificationhubs-dotnet.
I'm closing this issue, as it is not specific to the .NET SDK.
from azure-notificationhubs-dotnet.
@brannon - is there a Github repo where we can raise general issues via the core implementation.
Also - apns-push-type is not mandatory for voip notifications - it just happens that NotificationHub will add it incorrectly if you don't.
Test send works for .voip
in production mode but fails in sandbox mode.
from azure-notificationhubs-dotnet.
Related Issues (20)
- [FEATURE REQ] Update Firebase Messaging to stop using old FCM APIs HOT 1
- Firebase Legacy HTTP Send API are to be decommissioned after June 20, 2024 HOT 2
- [BUG] NotificationHubClient.GetRegistrationsByChannelAsync not returning any result on IOS
- [BUG] Azure notification hub doesn't accept token format from firebase_messaging
- [BUG] Notifications continue to send after deleting an installation HOT 2
- [Question] Azure Notification Hub on MAUI HOT 25
- [BUG] MessagingEntityNotFoundException when getting notification outcome details
- The Push Notification System handle for the registration is invalid
- Option to connect by Managed Identity
- Links routes to page: content not found (404)
- Why is the notification hub client missing BrowserNotification support?
- [BUG] 4.2.0 adds support for FCM v1...but no way to call SendFcmv1NativeNotificationAsync since it's missing from the INotificationHubClient interface HOT 2
- Issue: Lack of Support for FCMv1 Credentials in Microsoft.NotificationHubs ARM/Bicep Template HOT 1
- [FEATURE REQ] Update out-of-date samples
- [BUG] template notification not working with FCMv1 HOT 2
- [FEATURE REQ] Add support for Browser (Web Push) HOT 4
- [BUG] Provide new nuget packages, and docs with examples that will show how to use Azure Notification Hubs with MAUI HOT 1
- [BUG] Microsoft.Azure.NotificationHubs Version=4.2.0 HOT 3
- [QUERY] Will the SendDirectNotificationAsync method still work with the internal shift to FCM v1 ?
- [BUG] Notifications Sent to All Devices Instead of Targeted Device with FcmV1 Installation in Azure Notification Hubs 4.2.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-notificationhubs-dotnet.