Can I integrate getstream.io notification services in Drupal 8 site? If no then any other way to use the notification services in Drupal 8 site? - drupal-modules

I need to add push notification in my web site
If a user has made payment for something... we show them alert in their account page on the website that you are now successfully connected to this community
If a user has done payment by check... we clear the payments by check through a cron job... once the job runs and payment is cleared... we show a notification to user whenever they log in saying that their check payment is cleared
A user sends a request to connect to an organisation... that organisation's admin should get an alert in their system saying that so and so person is pending approval from you.
Something similar to alerts that we get in our net banking might be... that your credit card payment is pending... something like that
Like we also get notifications on Facebook... the difference will be that instead of notifications we want to show alerts or messages directly displayed in their account

So, you want notifications in your system about payments.
In its simplest form, you could do it manually with emails, and/or popups in your application, that are loaded from DB when they login. This is sort of a manual system, and the Minimum Viable Feature could be quite easy to build yourself.
If you want it more advanced, like you mentioned, similar to Facebook's notifications button and feed. Then, yes, it might be easier to use getstream.io. It also has websocket integrations so you can get those notifications pushed in real-time. You can then also push other types of notifications in there, like for example: a notification when the user has logged in from a different browser (for security reasons).
I hope this answers your question.

Related

Getting Payments Alert from Stripe without Webhook

The default way for third party clients to be notified when a payment has happened on stripe is mostly via Webhooks. However, I do not want to stress my users by giving them a webhook url to paste in their stripe dashboard to be notified when payment has happened. I want to simplify the process for them. Is there an alternative flow?
I'm looking at something similar to Sign In With Google once they authenticate the app against their stripe dashboard, payment alerts can be seemlessly retrieved.
Going through the Stripe connect Docs and I'm not sure Connect can be used to achieve this. I stand to be corrected though.
I need to implement this in NodeJS.
Any insights would be really appreciated.
Thank you.
It's not entirely clear what you're trying to achieve, but it sounds like you're operating as a platform and want to send some message to your users (who are Stripe account holders) to notify about payments.
You can do this using Connect webhooks to listen for payments on those connected accounts, eg by listening for payment_intent.succeeded or what is relevant for your integration.
You, as the platform, would set up a webhook to listen for these events, then you can use whatever communication channels you prefer with your users to notify them (eg: email, SMS, in-app notification etc)

Personalized web push notifications

I want to send web push notifications to registered users, are there any best practices on how to implement the cases when multiple users have access to the same device and one should not see the message of another user.
Thanks in advance.
A web push notification subscription is tied to the browser, not the device.
What you need to do is, map this id with your registered user when he logs in from a particular browser. Also, you need to remove the subscription id mapping with any other users in the system.
In the case of multiple users using the same browser, the above logic will make sure that at a time, a particular browser subscription id is linked only to a single user.
And when you want to send a notification to a registered user, you can retrieve all push subscription IDs linked to this user in your database, and trigger notifications to those subscription IDs.
And don't forget to unmap a subscription id when the user logs out from a browser. Otherwise, he will continue to receive all notifications even if he has logged out.

How to make your own push notification service for your website

I am working on a website, where I want to make a feature of notifications, when a user visits my website, they are asked for notifications permission and when they allow it, they will get notifications from my website, and whatever product I want them to get notified by.
Like for example when I visit some websites, they ask me for notifications permissions and when I allow the, I get notified through notifications then. That's all I want for now.
How can I achieve this functionality, I have follow this tutorial, but still confused how the users who allowed the notifications get detected and how all of them are notified then ?
Web Push library for node.js is just a sender.
You should obtain a subscription JSON object from the browser using Notification API and Service Worker API and then send it to your server, where put it in the database of your choise.
When you will need broadcast notifications, you can retrieve subscription and use a web-push library (for php is also available :)
Note that is a right flow looks following as:
1) Retrieve subscription from the browser
2) Send and store it on your web-server
3) Create notification prototype (just object)
4) Broadcast notification prototype ID you have created to the users
5) Service Worker receive one and fetch notification prototype from your server by ID
6) Show notification using browser API in service worker
For more see here links
https://developers.google.com/web/fundamentals/codelabs/push-notifications/
https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications/

Test scenarios for tip webhook test

I am developing a new feature, which will listen to tip notifications on venues, and I am having trouble to test it.
As far as I could check, to create a venue, and subscribe it on my foursquare app, I need to pay.
Is there any alternative to simulate or test, tip notifications?
On the app there is a test button, that only send checkin notifications.
I need to test it on dev environment before sending an untested code to production.
You can only get venue notifications for venues that you are a manager of.
See info on the venue push API here. https://developer.foursquare.com/overview/realtime
This API is designed for applications whose users are managers of
venues, allowing the application to get a real-time view of activity
at their venues. The Venue Push API will push to your application
content from venues managed by any of your application's authorized
users (or at a home venue that was created by one of your
application's authorized users). Supported venue content are
check-ins, likes, tips, and photos at the venue.
It's important to stress that in order for your app to see pushes for
a venue, at least one of this venue's managers must have authorized
use of your app, otherwise you may see “Your app can't see pushes from
that venue” errors.
After exchanging several emails with api#foursquare.com, they set me as a manager of a venue I created on http://foursquare.com/add-place, and finally I could move on with my tests.
I strongly recommend to Foursquare to create some kind of test for all possible Real Time API notifications, or create some kind of sandbox.
Thanks.

What draw the borderline of abusive use of Facebook Chat API

The facebook chat api is a power tool. From a purely technically point of view, it definitely does more than its predecessor of private messages in the Graph API.
This brings up a question of where Facebook is drawing the line of abuse of its chat api.
So here's how I'm planning to use the Facebook chat api for my app.
The app is an event planning app that lets users invite their friends to an event. Other than sending SMS, and emails to notify the guests, the most reliable way is to send invitations through the list of facebook friends. And let's face it, sometimes you may not have the person's phone number in your contact book, and you definitely don't remember most of their emails, so facebook is your only source for reaching them.
So I need a solution to send invitations to the guests. Here are my requirements and conditions:
The guest is a facebook friend of the user
There's no way of obtaining the guest's email (unless the user enters it) or phone number (ie. sms is not an option)
Each guest must receive a link that is unique to him/her
No one else should be able to obtain this link (ie. the message shouldn't be seen publicly)
It must not require the user's interaction to send these invitations (imagine having the user confirm a facebook post 10 times for the 10 facebook friends he's inviting). The invitation must be sent automatically.
Here's the obstacle. Facebook had revoked the functionality to send private message recently (I was able to have my facebook friends send me private messages via an app just over a month ago, not anymore). However, I discover that I could do so using Facebook Chat API.
This seems to be a grey area, my app is using the chat api for the sole purpose of helping the users notify their friends of their event invitation. There's no intention of abuse (such as mass messaging everyone of the user's friends with a link to my APP/website). Is Facebook going to hunt me down and revoke my App's privilege to use Facebook's API?
Can anyone shed some light on whether my intended usage of the API is an abuse or is it legitimate? If it is not legitimate, what are your suggestions.
I'd recommend using core functionality wherever possible here. For example, you could utilise the Facebook 'Event' object and the Graph API to create invite-only events and to invite individual friends of your app's users. This would deliver the same functionality without the need for nonce-based invite URLs and possible misuse of the Chat API. Take a look at https://developers.facebook.com/docs/reference/api/event/#invited for details.

Resources