1

We have multiple scenarios where from an Azure App Service for Mobile web api we need to deliver push notifications to multiple client apps. One example is the following:

We have an API serving a mobile app for a single institution with its own branding. This app needs to receive push notifications. We now have new clients, other institutions, that insist on having their own branded version of the app, served by the same API.

How, using Azure, can the API deliver notifications on certain events to all apps for each institution? Is there Azure support for this or does there have to a new notification hub for each app?

Sentinel
  • 3,582
  • 1
  • 30
  • 44
  • Possible duplicate of [Azure notification hubs - how to set multiple apps on the same hub](http://stackoverflow.com/questions/27247622/azure-notification-hubs-how-to-set-multiple-apps-on-the-same-hub) – Baris Akar Oct 17 '16 at 15:27
  • 1
    Azure Notification Hubs doesn't support this. You will have to configure one hub per app and communicate with all hubs from your backend. See http://stackoverflow.com/questions/27247622/azure-notification-hubs-how-to-set-multiple-apps-on-the-same-hub – Baris Akar Oct 17 '16 at 15:30
  • Did you ever come up with a plan for this? I am faced with something similar - I assume I will need to create multiple Notification Hubs - and manage the multiple MS_NotificationHubName, MS_NotificationHubConnectionString values to target the correct Hub when required. But do you know if the Azure Mobile App Service make any assumptions under the covers about a single Hub (aside from the Azure Portal UI which clearly only supports one Hub)? – oatsoda Jul 07 '17 at 13:33

1 Answers1

0

You can do that by sharing a single hub through all the apps if your architecture allows it. You'd have to manage tags to differentiate between those clients.

Read more about tag management.

Let me know in the comments if you have additional questions and i'll update the answer accordingly.

Nikita R.
  • 7,245
  • 3
  • 51
  • 62
  • Not as far as I can see. Each app has a different client certificate and Azure App Services for Mobile does not allow sending to apps with different client secrets. – Sentinel Oct 17 '16 at 22:08
  • I think you can decouple NH from Mobile. Just create a separate hub from scratch (out side of your Mobile app) and use it as if it was a third party service. – Nikita R. Oct 17 '16 at 22:48
  • 1
    Hi Nikita - thanks for your responses so far, but I still can't see the way to do it. Take a look please at the following guide from MS: https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-windows-store-dotnet-get-started-wns-push-notification/ at step 6. It seems that there is no way for the hub to have more than one secret key, and I don't know if that key can be hardwired into the client apps or if that's part of the store info. I assume the same considerations apply to ios and android. – Sentinel Oct 18 '16 at 08:47
  • I apologize if I misunderstand your problem, but why do you need multiple secret keys? If you're going to share a single hub between different tenants and differentiate between them by doing careful tag management, then you're indeed going to have a single hub with single secret. What you need to make sure is that each time you create or update a registration/installation of a particular device, it has to have a tag that uniquely identifies the organization associated with that instance of the app. – Nikita R. Oct 18 '16 at 17:23
  • Because the customers require different branded apps in the store. There's one codebase and one backend API, but each customer wants their own app...eg: one for Starbucks, one for Subway,...each with their own store presence. – Sentinel Oct 19 '16 at 10:51