Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between azure notification hub and azure mobile services

Tags:

What are the main differences between azure notification hub and mobile services

Which is best to use when.

Thanks

like image 842
Rusty Avatar asked Oct 17 '13 10:10

Rusty


People also ask

What is an Azure notification hub?

Azure Notification Hubs is a massively scalable mobile push notification engine for quickly sending millions of notifications to iOS, Android, Windows, or Kindle devices, working with APNs (Apple Push Notification service), GCM (Google Cloud Messaging), WNS (Windows Push Notification Service), and more.

Is Azure notification hub free?

Notification Hubs is offered in three tiers—free, basic and standard. Base charge and quotas are applied at the namespace level. Pushes exceeding included amounts are aggregated at the subscription level for each tier.

How do I make Azure notification hub?

Sign in to the Azure portal. Select All services on the left menu, search for Notification Hub, select star ( * ) next to Notification Hub Namespaces to add it to the FAVORITES section on the left menu. Select Notification Hub Namespaces. On the Notification Hub Namespaces page, select your namespace from the list.

How can we add support for push notifications in Azure mobile Apps?

In the Azure portal, on the Notification Hub page, select Windows Phone (MPNS) from the left menu. Enable either unauthenticated or authenticated push notifications: a. To enable unauthenticated push notifications, select Enable unauthenticated push > Save.


Video Answer


1 Answers

Those services have a totally different purpose.

Mobile Services allow you to provide a backend to (mobile) devices running your apps. Imagine a database that is exposed via a REST based API. You can react on CRUD operations by writing JavaScript code (Azure uses node.js for this purspose) and restrict the access to the database. This allows you to rapidly develop new apps (or at least proofs). Via JavaScript you can send push notifications by communicating the Windows Notification Service (WNS), the Apple Push Notification Service (APNS), etc. or by accessing an Azure Notification Hub, but that's not a native capability provided by the Mobile Services, it's just talking to external services.

Azure Notification Hub allows you to manage push subscriptions on multiple platforms (iOS, Android, WP8, Windows Store) with one single component. You no longer need to track the subscriptions in your own tables (like you would need to do with a solution just based on Mobile Services) and don't need to care about scaling. Imagine different devices registering at this hub and you have the ability to send a push message to those devices without the need to know, what kind of device you're talking to. It's just an abstraction of pushing messages.

To clearify:

Pseudo code with manual subscription handling vs. Notification Hub. Manual way with direct communication with WNS/APNS/...:

// query your data tables to determine the devices to notify // note, that you need to manage (insert, delete) all of those entries as well var subscriptions = ...;   for (var subscription in subscriptions )  {   if (subscription.Type == 0) // WP8   {     // communicate with the Windows Phone push service to push   }   else if (subscription.Type == 1) // iOS   {     // communicate with the Apple Push Notification Service push   }   else if // etc. } 

With Notification Hubs:

// determine subscriptions to notify by tag, it's just that simple var tag = 'player:12345';   var hub = azure.createNotificationHubService(/* credentials */);  // you don't need to care about WNS/APNS/..., the hub will do that for you hub.send(tag, yourMessage, /* callback */); 

I hope you get the picture.

like image 200
Gene Avatar answered Oct 12 '22 23:10

Gene