Telegram bot api: disable push notifications for sendMessage - php

I use telegram bot api to send messages to a channel. I need to disable push notifications for Android and IOS, but when I pass disable_notification = true, I don't get notifications for my desktop client, but my Android and IOS devices get push notifications (without sound).
Is it possible to disable push notifications for Android and IOS for telegram bot api and method send message?
P.S: I use PHP for sending messages to telegram.

No, the user should mute the bot.
disable_notification is only for channels.
From Bot API:
Sends the message silently. Users will receive a notification
with no sound.
The link refers to the channels

Now it's possible to pass disable_notification to sendMessage method -- https://core.telegram.org/bots/api#sendmessage
bot.sendMessage('chat_id', 'text', {disable_notification: true}

Related

IOS push notification banner

I am working in PHP. Now I want to send a notification that banner must not show on ios device but payload received by IOS device. This push notification will be sent from PHP.
Now I simply send the push notification in such a way that IOS device receive paylod only but must not show the banner and also not produce sound
{"aps":{"alert":"","badge":69,"sound":"","content-available":1,"mutable-content":1},"data":{"id":xxxxx,"badge":69,"type":"chat_message","message":"post.lambda sent you a message","content":"dmdnZ2c=","status":"S","sent_at":"2020-01-29T12:25:22Z","is_mute":true,"post":null}}
Above code that I write when I send this payload to IOS device then IOS device receive badge but not perform any other operation after receiving the notification
I did not found any solution that work perfectly in my case.

what is the proper way to save a firebase push notifications sent

I'm using firebase push notifications php api with android...
When I send a notification from firebase API, to android device, I also make a MySQL input, to register one copy of that, and work!
but...
What happen when the API sends too many push notifications?
There is no problem with my shared server?
I'm worried that my server will collapse for too many records for each push.
Right now It work like this...
Firebase API PHP send notification -> MySQL register that notification in one table -> Android Device recieve the notification.
but I don't think this is the right way...
so... the question is...
what is the proper way to save a firebase push notifications sent...?

Send push notification to APP without device token or register id

I have already experienced to send push notifications to android and apple device with specific device token or registered id and I did use it in different projects, but this time I am just looking for a solution where I can send a push notification to APP means whoever installed the APP will get a notification.
Please let me know if this is possible and if yes then how.
Thanks
You need push tokens to send notification and there is no option to send push message to all devices without knowing their token . But you can send topic notifications if user has subscribed to that specific topic . You may need topic subscription to send push message to all subscribed users .
Client side you can subscribe to topic like
FirebaseMessaging.getInstance().subscribeToTopic("TestTopic");
find it here

Send notification globally using FCM

I want to send notification to my iOS application from server side. I am using PHP at server side and FCM to send notifications. I have the server_key for my firebase project.
I sent the following to FCM
{
"to": "red_id",
"data": {
"message": "This is a Firebase Cloud Messaging Topic Message!",
}
}
But I want to send notification globally without using "to" clause. Need help
Firebase Cloud Messaging always send messages to specific targets. While those targets can be broad, there is no way to send untargeted messages.
If you want to send a message to all users of your app, the easiest way is to have your app subscribe to a topic (e.g. all on startup. That way you can target all users of your app, by sending a message to topic /topic/all.

YII2 push notification in a browser

I have to implement notification to users when the news on a site is added.
I have done this via email and now I have to do this notification in a browser. I guess, I should implement a push notification.
How can I add a push or any other suitable notifications in a browser ?

Categories