Giter VIP home page Giter VIP logo

Comments (7)

brannon avatar brannon commented on June 2, 2024

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 the voip 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.

idevchris avatar idevchris commented on June 2, 2024

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.

sadgit avatar sadgit commented on June 2, 2024

You need to create separate notificationHubs for each of

  1. bundleId + sandbox
  2. bundleId + production
  3. bundleId.voip + sandbox
  4. 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 on sandbox + voip hubs

from azure-notificationhubs-dotnet.

brannon avatar brannon commented on June 2, 2024

@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.

brannon avatar brannon commented on June 2, 2024

@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.

brannon avatar brannon commented on June 2, 2024

I'm closing this issue, as it is not specific to the .NET SDK.

from azure-notificationhubs-dotnet.

sadgit avatar sadgit commented on June 2, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.