Push notifications using Grease/TamperMonkey userscripts? - greasemonkey

I would like to push notifications or updates out through my userscript. It's coded in Javascript, like all userscripts.
The only thing I have thought about, is getting a server which would host my file. Then the userscript would check if that file has been changed, and if it has, then display the new message. Basically allowing me to push out messages.
Is there a way to do that? Push notifications or updates without using a server, because that would be too much. I use http://userscripts.org/ for hosting my userscripts, but I haven't been able to find any way of pushing out notifications.

Related

How to send a notification at a random time?

I would like to find out how, using Node.js, Express, Typeorm I can send notifications at random times to users to add a post etc.
I would like to create something of the BeReal sort. Notifications should be sent according to the user's selected time zone at random times.
If you want to send automated notifications, I'd recommend using
node-cron. However, for your case, I'd propose to add a timeZone
indicative information in the database to link the user with the
timeZone(you can find it in HTTP Requests, update it after each
login).
For the actual sending of the notifications, I think you should use
some third party service like Google Firebase for mobile
notifications, and web-push for web applications.

How to get instant changes in background from private api in mobile app?

I am planning to create a mobile application for android and ios users, i think i will take a try with xamarin since i will be alone on this project and i don't have a lots of time.
I want that the mobile app for both platform get datas from the api, then if there is new datas available we notify the user by a notification.
How the mobile will work in that kind of project? I mean should i make a background service then check every x seconds/minutes by http request? In that case which time interval? Should i use websockets instead for this case?
The app might be used by many people, so i would to know the scenario in this kind of project: Getting very fast changes, without overload the server due to too many connects or whatever else.
I'm confused about this and i need some lights around, any mobile application/server experiences related would be apprecied!
EDIT:
As suggered by an user, here additional infos:
The api is homemade, restful using JWT made in NodeJS.
Each users on their device should get messages from server asap, even when the app is in background/closed.
Maybe in the future a way to send messages between users themselves.
You have to implement push notification.
It is quite easy to implement this in xamarin. just send the push notification to the device and on the notification received call back send the API request to retrieve the updated data.
Here is the document for sending push notification from custom API.
https://learn.microsoft.com/en-us/appcenter/push/pushapi
I'm not a mobile developer, so take this with a grain of salt.
The answer to this really depends on what you're doing, which informs how often to check the API. If it's a messaging app, for example, you could have it check every couple minutes to see if there are undelivered messages, then check more frequently for the next X minutes (to facilitate a conversation in real time).
If it's a GPS navigation app to be used while driving, you'd need much more frequent requests.
As for the API, that also depends on what type of API and the number of requests you can make to it. Is it a commercial API that you get x number of calls per hour on? Is it an API that you built? Etc.
Basically, you need to give more information in order to get more specific answers.

Web push notification click action tracking

I am developing a website to send push notifications to my subscribers' using Firebase Cloud Messaging (Chrome & Firefox browsers) without using any third-party API. Push notification sending is working fine, but I don't know that "How to track notification click action". I can track click action by using JavaScript (ajax call) but I am not sure this will be right choice to proceed.
For example, consider that I am sending push notification to 1,00,000 subscribers in that if 50,000 subscribers clicked on that notification in few seconds, then it will be burden to the server. Is it possible?
Or Is there any other way to track push notifications click report from FCM. If so how to accomplish this?
Please help me out!
You can add the date to your URL like this:
yoursite.com/article/lorem-ipsum?utm_source=notification&utm_campaign=1554750619
Then on your GA you can generate reports based on your campaigns.

Firebase (Google) Cloud Messaging (FCM, old GCM) - check message status

I'm trying to find a solution to ensure a push notification to my Chrome extension has been received before sending another one. IF it hasn't been received and another one should go, I would change its content to tell the user he has multiple new informations to check.
So I'm looking for a way to check the previous message status using its ID, or check the queue of messages if using a collapse key, before sending a new one. But I can't find anything related to this, except here : https://support.google.com/googleplay/android-developer/answer/2663268?hl=en there is FCM message status detailed, but no way to get them after the first response.
I am aware receipts can be implemented using XMPP but I would really prefer to remain on the regular HTTP protocol.
Thanks ahead for any help.
XMPP receipts would be the recommended way for you to get an ack that the message was delivered. You can also use the Play Developer console (Android developer console) to view statistics on the status of messages. However this will not be sufficient if you want to automatically resend, you would have to do this manually.

Gmail push notification error (Only one user push notification client allowed per developer)

I tried to execute gmail api's watch on my two gmail accounts and it works fine.
But when the other user tried to do so, it shows this error:
HTTP error 400 : "Only one user push notification client allowed per developer (call /stop then try again)">
I don't know if the problem is on the pub/sub client configuration or doing stop and watch will resolve the problem?
Can someone explain the meaning of this statement "Only one user push notification client allowed per developer"?
Try using a different project for the Cloud Pub/Sub topic that the other user wants to set up a Gmail API watch on.
You can always renew a watch by first stopping the watch and then immediately initiating a new watch right after. So, try to use users.stop once before you use users.watch.
I have encountered a similar issue. Although this might not be helpful to the OP, for me the solution was to abandon Google's Pub/Sub and use IMAP IDLE instead, which is much better suited for OP's use case of monitoring several inboxes.

Resources