Browser Push notifications for Microsoft Edge server side - microsoft-edge

From what I read, Microsoft Edge still does not support Web Push (it is still under development, as per site ). So what is the best way to implement browser push notification for Microsoft Edge?
The link - https://learn.microsoft.com/en-us/microsoft-edge/dev-guide/device/web-notifications-api - explains how we can send from a Javascript. But am trying to understand how I can send a notification from a different server side component (Java), to Microsoft Edge browser? Do we get any tokens like how we get when we use FCM in Chrome? Can someone provide me pointers on this? The application running on Microsoft Edge will be an angular 4 app.

You need to use the Javascript Fetch API, AJAX, Long Polling, WebSockets or SSE. Once you get the notification on the client side you can use vanilla Javascript and the Notification API to display the notification.

Related

How to programmatically send a message to a Teams BOT

I have a BOT running which reponds to api/messages URL from the BOT Framework Emulator, and I can send text to it.
However what I need to do is write an application which sends text to the BOT over this URL. That is basically does what the BOT Framework Emulator does when I enter text and send it, probably over the graph API.
I am aware of information which demonstrates sending to a chat in a channel, but I just need to send to the BOT itself.
Can anyone advise how I can do this, or is there a suitable sample which demonstrates it.
Thanks
At the end of the day, your bot is really just a web api endpoint. If you set up a tunneling service like ngrok, you can use it's built-in web viewer to see the traffic that is sent to you bot, e.g. via the emulator or even via the azure bot registration page (there is a similar emulator built into the page in Azure). Once you've seen that traffic, you can essentially just mirror it from whatever you want to call from - it's essentially a json payload.
However, considering your bot is just a web api, I'm not sure why you want to "call" your bot from another app. Why not just make another endpoint that you can use for app-to-app communication (like a normal api endpoint). You can then refactor your code so that whatever you need to do can be done either via a bot message OR via the API call.

Push notification using FCM for web app in Ruby on rails

I have previously worked on push notifications with FCM for android app. From Firebase console i got server key to which my backend program hits when the notification were expected to be delivered. Also I could easily get the device token from the console(on client side) to which the server would send the push messages.
Now in similar way i would like to implement web push notification using FCM. Unfortunately, could not find FCM set up and implementation documentation using ruby. Besides bit confused as to how i can get the device token for web client to whom i would like to send push message/notification. What things do i need to look at and that i am missing?
I have come across web push gem and terms like VAPID keys and service worker but still confused how they work with FCM. If anyone could help me out with what i should be looking at and what i am missing. Thanks for reading this far.
Getting the FCM token for a device is only supported in client-side code. For web applications, see the documentation on getting the registration token. You can then pass the token from the client to Ruby backend, where you can store and use it to send a notification to that specific client.
To send a message to the token from your Ruby code, you can call the FCM REST API, after providing proof that your request is authorized with one of the methods outlined in the docs on authorizing send requests.
If you're having trouble making this work for your use-case, it's more likely that someone can help if you edit your question to show what you tried based on the above information and other existing resources.

Custom Push Service

In the context of pushing notifications to web-browsers, the PUSH SERVICE acts as interface between the SERVICE WORKER and APPLICATION SERVER.
My current understanding is that
Google FCM is the Push Service for Google Chrome & FireFox browsers
APNS (Apple Push Notification Service) is the Push Service for Safari browser
Here, is it technically possible to substitute the ‘push service(s)’ (– i.e., Google FCM for Google Chrome & FireFox browsers and APNS for Safari) with a generic custom service worker which could potentially address all the popular browsers that support Service Worker and Push API?
In other words, whether developers have control over which push service to be used for a browser (or) develop a custom push service for all the browsers?
You're mostly correct: the Push Service acts as an interface between a service worker and application server, with the addition that the service worker (or potentially the web app) sends subscription info to the application server outside the Push Service, so the application server knows the endpoint and how to properly encrypt any notification content.
Google uses GCM/FCM for Chrome, and Mozilla uses its own Push Service in Firefox for desktop, while using GCM/FCM and/or its own service for Android; see the "What information does Firefox use to provide Web Push?" section here.
At the time of writing this, Chrome, Firefox and Edge support the Push API, so there's no need to handle each seperately (WebKit doesn't support it).
Short answer: developers don't have a choice in which Push Service the client uses, but the adoption of the Push API standardizes the service worker and web push across major browsers (excluding WebKit).

Sending email in Azure IoT edge using function

For the IoT edge function, input trigger is edgeHubTrigger and the output is edgeHub. How can we send email in IoT edge using function? And will this be suggested approach to do in IoT edge or we need to send to IoT Hub and the listener function (in the cloud) listens to IoT hub send email?
If your Edge device, and your Edge function, have access to a mail server (or a service like SendGrid), then sure, you should be able to send emails. You should be able to use any .NET SMTP client library (or again, something like Sendgrid with their SDK).
If I would consider it a great design to send mails from the Edge device? This depends a bit on your scenario I would say: If you want to use some on-premise mail server, which is reachable from your Edge device but not from the cloud, then this might be a valid approach.
But if you use a mail server that you reach over the internet or some cloud mail service, then I would probably rather send those messages from the Edge to the IoT Hub in Azure (and put a property on them for routing), route them to an Azure Function and send them from there. This way you avoid putting your send logic onto each and every Edge device. Plus you automatically benefit from the message caching of the Edge Hub in case your Edge device is offline for a while.

What is the most efficient way to create end-points for an Amazon SNS service?

I am using Amazon SNS Service for an iOS application that needs push notifications.
I have figured most of the things, except for the part where I have to register my device tokens.
This is where Amazon talks about it. It can be done manually or with the help of createPlatformEndpoint API which they obviously recommend for bulk uploads. My question is how we can directly register tokens from devices that will install the app later on. The documentation talks about a proxy server which I would want to avoid as of now. Isn't there a direct way of doing this, like where I can directly call a method and push the device token received in the application to my SNS Platform?
This, is a possible duplicate except that it is in reference to Android.
The AWS Mobile SDKs support accessing SNS directly from the mobile device. If you're interested in seeing code demonstrating this on iOS, we included some as a sample we prepared for re:Invent 2013 called Mobile Photo Share.
The important thing to note when accessing SNS directly from the mobile device is that you'll want to restrict the credentials delivered to the device to only those services and resources you'll need to access. You can accomplish this via web identity federation or a token vending machine with appropriately restricted policy.
If you want to learn more about the Mobile Photo Share app, we had two talks at re:Invent about the app and its architecture. The video and slides for those talks are available here:
Building Cloud-Backed Mobile Apps
Integrating Social Login Into Mobile Apps

Resources