Do I need to access to different servers to implement the Web Push API on different browsers? - web-push

I am implementing a very small wpa. in this application, I need to initiate some messages to the client via the server.
I have checked the information about web push notification and technically it is possible to implement it.
But according to my understanding, I need a Push Service to act as a bridge between my App Server and web browser. Different browsers use different Push Service, for example, Chrome uses FCM, Firefox uses its own, and Safari uses Apple's.
So if I need to send this Push message, I must target the user in different browsers, and then App Server sends it to different Push Service Server?
Or furthermore, even if I can send a push message to FCM, Firefox and Apple's Push Service Server now, but the user opens it with Edge, I can't send it to him now?
Is it possible to deploy a Push Service Server by myself?

Related

firebase sending messages to multiple devices on web

I need to use firebase cloud messaging application in web application development. I am able to send the push notification to a single client from the server. But I dont know how to subscribe tokens, i.e, sending push notifications to multiple clients from a single server. Is there any example code available for sending messages/notifications to multiple clients?

Firebase push notification using node js and polymer web app

I want to send device push notification to android app. Here is what I am doing:
Created a webapp server(node js) and client code is written in polymer.
Deploying this webapp to android device as android app using some third party android container(Predix Mobile).
The third party container takes the web app and deployed it into android device as android app.
The third party web app doesn't have any plugin which can generate device token used to send device push notification using google firebase.
I have a login page in my web app, when I login, I want to generate the device token. But I can't find any help how to do that, because my client code is written in Polymer.
I will send that token to my server code which will be deployed to cloud, the server will do a post call to push the notification to device.
Is there a way I can achieve this?
I used OneSignal to do something similar in a project.
https://onesignal.com/
Your UI loads in a webview and you have full control of the MainActivity. In your micro service, you can make a call to the OneSignal API with the message you want to send as a push notification. You can handle the push notification in your MainActivity. You can send notifications to a specific device, a group of devices, or all devices running the app.
You can create an interface between your MainActivity and Polymer WebView to move data between them.
https://developer.android.com/guide/webapps/webview.html

RESTful API, tracking client's individual user requests

I have an API set up on my server (node.js) which potential clients can send request to. One such client would like for me to set up a structure where they would pay only for the amount of their users who would connect to my API. They are creating a mobile application. Regardless mobile or web, I'm not sure how I would be able to track their individual users, to make sure it is their users who are sending requests to my server and not the client himself. The client can make one request and send to 1000 of their users instead of 1000 of the client's users directly connecting to my server.
The only feasible solution I can think of is creating a plugin which they would insert into their app and it would connect directly to our server, bypassing the client's server. Something like a Facebook Share/Like, Google +1 button. Creating the plugin would require to create the entire request and dynamic layout in each platform language, which is outside my scope at the moment.
Is there any way to have the end-users connect directly to my server through the client's app, bypassing the client in the middle, allowing me to know how many users will be connecting?

Authenticated push notifications without publishing the App to the Windows Phone Store

We are currently developing a Windows Phone 8 application that won't be published to the Windows Phone Store but will be distributed through our Company Portal (Windows Intune Direct Management).
Our team would like to add Push Notifications using MPNS (Microsoft Push Notification Service) but we are aware that, without submitting the app to the Windows Phone Store, we would be forced to use unauthenticated push notifications that are throttled to something like 500 notifications\day per subscription.
We are evaluating to try a service like Azure Notification hub but It's hard to find some clear documentation about how to set up authenticated push notifications with Notification Hub and even more important, if Notification Hub has the same policy that force to submit the mobile application to the Store.
So, the questions are:
In order to use unthrottled authenticated push notifications, do you know if Notification Hub requires the app submission to the Windows Phone Store?
Do you know any other valid way to get no-quota push notifications?
Microsoft has finally updated its term of service enabling no-quota (unthrottled) notifications for company apps on Windows Phone.
Create a Windows Phone Store developer account if you do not have one. Even though you won’t be submitting apps to the store, you will
need to use the Windows Phone Store to manage your certificate.
Prepare your push service to use the authenticated endpoint as documented here. Also, retrieve your certificate and set up its
service as outlined here.
When you have completed the steps above, do not link it to any app.
Official link:
blogs.windows.com/windows_phone/b/wpdev/archive/2013/12/10/enabling-no-quota-push-notifications-for-company-apps-on-windows-phone.aspx
I do not pretend to be completely correct, but this is what I can say after deep diving into Notification Hub stuff:
MPNS uses either http or https (for authenticated notifications) protocol to deliver data to its clients. Its internal structure can be roughly described as sending a specific xml (or json) to a previously set URI. It has no access to MS marketplace and cant do any app checks. So it seems you can push to any uri you want (I didn`t try that). Notification Hub is a WRAPPER over mpns, wns, apns, gcm, optimized for large arrays of notifications.
Notification Hub has the ability to set the mpns certificate inside the configuration tab, and I think that doesnt mean you`re forced to have an app in a public store with the same certificate.
Hope this helps,
Best regards, Alex
I believe that Notifications Hub will use either unauthenticated push notifications (same restrictions apply) or require the certificate to use authenticated push notifications, which requires registration in the store.
I'm not aware of a way around this at the moment.
I found a page from MSDN
It looks like kinda out of date (Windows Phone Marketplace was the name in WP7 days).
But the 500 limitation isn't changed, and like Alex Yurov said, Azure Notification Hub is just wrapper over MNPS, so this should apply.
So basically your need to re to register a certificate. Your cloud service will use this certificate to talk to the MNPS/Notification Hub, then it's unthrottled.
Unauthenticated and Authenticated Mode
Push notifications can operate
in unauthenticated or authenticated mode. In unauthenticated mode, the
number and frequency of notifications allowed through the Microsoft
Push Notification Service is throttled (unauthenticated push
notifications are currently limited to 500 per day, per channel).
For push notifications in authenticated mode, developers first must
register a certificate with the Push Notification Service through
Windows Phone Marketplace. The certificate must be issued by a
Microsoft-trusted root certificate authority. This certificate then is
used to establish a Secure Sockets Layer (SSL) connection between the
web service and the Push Notification Service. Authenticated push
notifications are not throttled.
UPDATE
This is the corresponding tutorial but NEW version.
No-quota push notifications using a root Certificate Authority

What connection do Facebook and GMail use for messaging?

I'm building a web app that needs to be able to immediately receive messages from the server (kind of an instant message chat).
I noticed Facebook and GMail have messaging in a browser and do not require any browser plug-in for that.
What do they use?
I know websockets doesn't work when relying through a proxy?
Is there another good method?

Resources