Custom Push Server Setup - azure

I'm researching about building a custom server for sending push notifications to clients Webapps (No android or iOS phones). What would be a reliable and scalable stack for building this service? Preferably using a microservice architecture. Thanks.
P.S. I already tried third party services such as FCM, OneSignal, but most of them don't offer a custom domain option.

You can use spring-boot framework for this, which provides easy configuration to connect with firebase using firebase SDK or API's.
Download firebase admin SDK : https://console.firebase.google.com/
Create spring boot application : https://start.spring.io/
Use private key JSON file to connect with firebase using SDK.
Expose REST end points to send FCM notifications.

For those looking for a current answer (April 2021), you cannot use your own push service because it is tightly coupled with each browser push API implementation:
But notice that we can't push notifications from our server directly to the user's browser. Instead, only certain servers that browser development companies (like Google, Mozilla, etc.) specifically choose will be able to push notifications to a given browser.
Link:https://blog.angular-university.io/angular-push-notifications/

Related

Is the Azure notification hub available to use?

We are developing a website and would like to use the Azure portal notification module. Does anyone know what this is built with and if we could implement this on our site rather than building from scratch? We have some some processes that take some time so want users to be able to go off and do other things and come back when it's completed. We host our product on Azure so if this is using an Azure feature then we can use this also.
Azure Notification Hubs provide an easy-to-use and scaled-out push engine that allows you to send notifications to any platform (iOS, Android, Windows, Kindle, Baidu, etc.) from any backend (cloud or on-premises).
Push notifications are delivered through platform-specific infrastructures called Platform Notification Systems (PNSes). They offer barebone push functionalities to deliver a message to a device with a provided handle, and have no common interface. To send a notification to all customers across the Android, iOS, and Windows versions of an app, the developer must work with Apple Push Notification Service(APNS), Firebase Cloud Messaging(FCM), and Windows Notification Service(WNS) separately.
Kindly take a look at the documents to know how it works, scenarios you could leverage Azure Notification Hubs for and how to integrate with your app.
https://learn.microsoft.com/azure/notification-hubs/notification-hubs-push-notification-overview
https://learn.microsoft.com/azure/notification-hubs/notification-hubs-app-service
Do provide more details on your requirement for better assistance.
The question is tagged for Azure Notification Hubs, but the screen shot you showing is for the notification section of the Azure Portal UI. I'm not aware that Microsoft makes the component available for third-party use.
Can you please remove the Notification Hubs tag from this issue as it's not related.

how to integrate getstream.io into cordova / phonegap?

i am using cordova to build native mobile app. I already have an account in stream.
Currently i need to build a feed like facebook into my app and would like to check UI/UX design layout is included in getstream.io ?
Second, how to integrate getstream.io into my cordova app ? is it just copy the getstream.js into my cordova app ?
We don't have any built in user interface, that's entirely up to your application.
We also don't recommend connecting directly to Stream from a mobile application for several reasons. For starters, your API credentials can be easily extracted from the application, which could cost you money if someone abuses your account. Secondly, the socket connections to constantly connect to Stream and read feed updates would use up a lot of battery and data for your users. Better to have your mobile app connect to a back end server, and have that server connect to Stream.

Do I need to connect Firebase to Azure Notification Hub?

I see that I can either connect directly (through Rest HTTP requests) to Google Firebase API but I can also connect it to Azure Notification Hub. I also understand that Firebase is free while Azure isn't.
Can you kindly describe what is the benefit of connecting Firebase to Azure rather than directly connecting to Google's API (if any)?
I'm using ASP.Net Core MVC as my backend.
Thank you
If you are doing one push platform only (Firebase in your case) and only considering basic scenarios, then there's not much difference between using it directly or via Notification Hubs (NH).
However, NH provides you with a set of really powerful features:
Cross-platform SDKs to allow device registrations from all major OSes and a unified way of sending pushes no matter which platform they are on
A feature that is unique across similar services is tagging and routing
Templating
Basic or extended telemetry
And some other features.
So, in short, yes you can do everything that NH does by yourself. It's just you'll spend a lot of time (and money on resources required to run it) while doing it. And this is an out of the box solution that has been tested through years and is used by some of the largest products on the market.

IMobileServiceSyncTable with generic API server

We have built a simple mobile app that connects to ASP.net Web-API 2.
We would like to use Microsoft client SDK for it's offline sync support.
Now that Azure Mobile Apps support custom authentication we could actually take the leap.
I want to know out if the offline sync SDK absolutely requires us to use Azure Mobile App or Azure Mobile Services.
Microsoft documentation is full of how-to guides but does not explain what happens under the hood. The best I could understand, both are just OData rest API's and swagger for documentation.
Can the Azure Mobile Client SDK work with API server created on top of ordinary ASP Web-App, outside Azure?
What is it about the Azure Mobile App that makes the magic happen?
Vladmir,
On top of OData, in order to support features like soft delete, offline sync and others, the Azure Mobile Client SDK expects the server to implement a certain protocol. So although the answer to your question:
[does the] sync SDK absolutely requires us to use Azure Mobile App?
... is no, and in theory, you could implement your own API, but I would recommend against doing so, since (among other reasons) even if you manage to implement the expected conventions and behaviors, this will become a maintenance challenge down the road if you need to upgrade the client SDK to take advantage of bug fixes and/or new features.
The good news is that with the latest release of the Azure Mobile Apps server SDK, adding mobile capabilities to an existing ASP.NET Web API application is trivial, and you should be able to enable the scenarios you're looking for simply by adding the appropriate Table controllers. So you can just enhance your existing application and not have to develop and maintain the Azure Mobile Apps specific logic yourself.
About your last question, since both, the client and the server SDK are both open source and developed in the open, you can look at what what makes the magic happen here:
https://github.com/Azure/azure-mobile-apps-net-server
https://github.com/Azure/azure-mobile-apps-net-client
I hope this helps!
The answer for your first question: Yes the SDK can be used in any Server API you have since it will be your entry point to work with Azure Mobile Services.
The Azure Mobile app creates a mobile services instance which has push notifications and SQL tables to store all messages you would like to send with the capability to customize the message as needed. Also it creates a notifications hub instance under the hood to manage notifications for all mobile platforms. Azure mobile apps provide offline capabilities through native sync services between db on your devices and the server when connectivity is present.
Feel free to ask more questions to have a full understanding on How mobile apps works.
Hope this helps.

How to use my own API instead of using mobile API in Azure

is there any way to publish my API in azure mobile service API instead of using its own. I want just to know it, because assume I have a backup server in amazon and as you know I don't have access to azure sdk in there and it means technically I cant use the API anywhere outside the azure.
Azure mobile services is actually based on the .Net web api in their C# flavor and on node.js on the Javascript side. You could surely write an API using those technology and have the same behavior. You will gain the fact of being more portable, however you will lose some of the preconfigured stuff from Mobile services.
If you are using .NET, please check this to see how to build a Web api! http://www.asp.net/web-api.
If you are using Javascript, here is where you should start : https://nodejs.org/
Both tech are quite easy to learn and super powerfull, have fun! When your API is built, you could just publish them as an azure Web APP (http://azure.microsoft.com/en-us/services/app-service/web/) or an Azure API (https://azure.microsoft.com/en-us/services/app-service/api/) instead of the mobile App
Hope it helps, if you have more questions, please ask!
You can create and publish your own custom APIs in azure mobile service. You could even access in via azure mobile service sdk in client by using "InvokeApiAsync<>()" method.
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn614130.aspx
If you want to access the api via fidder/httpclient than AZM SDK, pass the mobile service key in HTTP header as Name:'x-zumo-application' value:'application key from portal'

Resources