How to send push notifications to Google Firebase web application - javascript

Can anybody provide information on how to setup push notifications for a chrome web application?
How to setup topics, create new topics, delete topics and what the syntax would be.
I searched the internet using what tools we have and come up with nothing.
Thank you.

There is no client-side API for web applications to subscribe to topics. You can use the REST API, but that requires running a trusted process (i.e. on a server). See my answer here for details: How to subscribe to topics with web browser using Firebase Cloud Messaging
Note that in general there is no API to create/delete topics. Topics are automatically created when you subscribe to them or send a message to them.

Related

Are there OpenSea Webhooks for monitoring NFT collections?

Does OpenSea have a webhook API for sales of a given Ethereum NFT collection? I see they have a streaming JS API which uses websockets but I can't seem to find a server oriented API.
They posted a reply to someone on Twitter in 2018 about clicking "More" then "Subscribe" on a collection webpage to setup a webhook but it seems this functionality has disappeared.
If not, is it possible to use their websockets JS api on a server (as opposed to a browser)?
And if that's not possible does anyone know of a solution to this problem (receiving POST requests on a server when transactions of a given NFT contract occur)?

AWS SNS with FMC for SMS

I am developing a React native application where I want to sent an SMS for OTP. I used AWS SNS for publishing messages after subscribing them to a topic, but I found that the price is quite high since the SMS is transactional.
I wanted to use Firebase Messaging Cloud since they do it for free but I don't really know how to proceed with it. Do I have to createPlatformApplication and then do createPlatformEndpoint for every user to send messages? This is a bit confusing for me, so if someone could give me an overview of the initial processes, it would do me wonders.
This is how I am doing it now simply using subscribe and publish:
I understood your question as asking how you could deliver OTP codes using push notifications.
To do that, you would:
Set up a platform application through SNS: https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-register.html
Create an endpoint for each end device you want to send these notifications to: https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html
Do a direct publish to that endpoint to send the notification only to that person: https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-directmobile.html
For this use case, you do not need to use topics and subscriptions, since all of your messages will only be targeting one person.

Getting feedback from a JavaScript application without a registering for a centralized service

I created a Chrome extension which is just HTML/CSS/JavaScript. When the user clicks on a button, I have it send a message to me. But the problem is I don't want to include any API keys or server information where the app can POST to as it can be used for abuse if someone was to extract this information from my Chrome app. Is there a method of getting a response from a web app with a public service where anyone can post to? I was thinking pastebin, but even that requires an API key.
You could ask the user to create their own key. For example, many GitHub extensions require an API key to make requests to the GitHub API, so what they do is they send you to a GitHub settings page where you can create a personal API key.

Looking for an azure service to manage web push notifications

I'm implementing a notifications feature in an html5 web app I'm working on.
The feature requirements is to receive push notifications (strings) from the server and display them immediately on the user interface (to all clients), without saving them anywhere else.
I'm looking for a managed service on Azure cloud that allows send/onMessage functionalities very similar to WebSockets, that can be accessed directly by the browser.
I've tried using event-hubs, but that solution requires a node.js/SignalR wrapper which I can't use for this specific feature.
Thanks in advance!
It sounds like you want to implement a real-time notification feature for HTML5 App without any middleware like WebApp in Node/SignalR to connect a message queue like EventHubs. However, there seems to be not any solution for the needs without any backend services as HTTP middleware for browser if using EventHubs or other services like PubSub in Redis.
Per my experience, a only available solution is that using pouchdb within browser to synchronize with CouchDb on Azure to implement a PubSub service as notification service.
There is a opensource project on GitHub which you can refer to, please move to https://github.com/MattCollins84/couch-pubsub.
Hope it helps. Any concern, please feel free to let me know.
Chrome M52 and beyond started supporting the VAPID protocol, refer to https://chromestatus.com/feature/5573539073622016.
It seems that Azure does not yet provide VAPID support. As an alternative you can look into Firebase Cloud Messaging (FCM) which you can connect with Azure Notification Hub.
More on Firebase Cloud Messaging and web push html client: https://firebase.google.com/docs/cloud-messaging/js/client
More on Azure Notification Hub and connecting it with FCM:
https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-android-push-notification-google-fcm-get-started
VAPID stands for: Voluntary Application server Identification for web Push. Refer to https://datatracker.ietf.org/doc/html/rfc8292

How to send web notification using OneSignal js

I'm new in OneSignal, and after cofigure my OneSignal, I want to send notification via my script using OneSignal API, can anyone help me? I doesn't have any idea for this, I have read the API referrence but I don't know how to start this.
Notifications can be sent through the OneSignal REST API, as documented here: https://documentation.onesignal.com/reference#create-notification
In general notifications should be sent from your server code, and not your client code. This is because sending a notification usually requires a private API key for security, and this key must be kept secret. You can find examples of how to do this in various languages near the bottom of the page linked above.

Categories

Resources