Well, I'm in a kind of a dilemma to go on with my Phonegap application development: for real time event notification, should I go with Azure Notification Hub or SignalR?
For my understanding, SignalR is good for real time web applications through the use of Web Sockets. Whereas notification hub makes it easy to send push notifications across multiple platforms. To make it easy to respond, let me explain the structure that I currently have and what my app is supposed to do.
The App: It's basically an app where users can create groups and invite other users. The user can also make a group "online" so other users can "enter" the group. While the group is online and the user have entered , they can send questions, exchange messages and so forth.
The need: When a user ask a question in a group, or enter/leave a group, the other users needs to see the new user in the app screen. I could do a polling on the server to check that and update the UI according, but this is something the modern days don't allow. My searches on the subject lead me to two things: SignalR and NotificationHub.
The current architecture: Client -> PhoneGap application with backbone.js. Backend -> Asp.NET Web API with Entity Framework and Azure Sql Server.
I've already put some thinking in the use of notification hubs and tags for that. For example, when a user enter an online group, it sends a request to the server to register a "grouplisten:{groupId}" tag. The server then registers the tag with the user's device and also fires a notification to all other devices with the tag "grouplisten:{groupId}", so the other users update the UI with the recently joined user. Also when the user leaves the group, it sends a request to the server to remove the "grouplisten:{groupId}" tag and also notifiy the devices with "grouplisten:{groupId}". But with this simple example, looks like this can become unmanageable.
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.
To set up Windows Push Notification Service (WNS): In the Azure portal, on the Notification Hub page, select Windows (WNS) from the left menu. Enter values for Package SID and Security Key. Select Save.
Azure SignalR Service simplifies the process of adding real-time web functionality to applications over HTTP. This real-time functionality allows the service to push content updates to connected clients, such as a single page web or mobile application.
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.
Both technologies have their pros and cons on mobile platforms:
Pros:
Cons:
Pros:
Cons:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With