Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to implement the "expiration" time in a Firebase notification sent from php server?

I've implemented a php server that send Firebase Notification to users that are subscribed to a specific topic of my Firebase project.

It works.

In the console of Firebase there is the possibility to set the "expiring time" of the notification (from 1 minute up to 4 weeks).

Is there a method to insert this possibility also in my php server?

Thank you

like image 942
Fabrizio Avatar asked Feb 11 '17 14:02

Fabrizio


People also ask

Is Firebase Cloud Messaging real time?

Firebase is a cloud service designed to power real-time, collaborative applications. Simply add the Firebase library to your application to gain access to a shared data structure; any changes you make to that data are automatically synchronized with the Firebase cloud and with other clients within milliseconds.

How do you handle Firebase push notifications?

Handle notification messages in a backgrounded appA user tap on the notification opens the app launcher by default. This includes messages that contain both notification and data payload (and all messages sent from the Notifications console).

What is Messagingsenderid in Firebase?

A sender ID: set in the code of your app. Android Studio uses automatically the Sender ID of your Firebase Project. If you are still using GCM, you have probably set manually the sender ID in the code of your app. The sender ID identifies your app to Firebase Cloud Messaging when it asks for a token.

Is there a limit for Firebase notifications?

Maximum message rate to a single device For Android, you can send up to 240 messages/minute and 5,000 messages/hour to a single device.


1 Answers

I think you're looking for the time_to_live parameter:

This parameter specifies how long (in seconds) the message should be kept in FCM storage if the device is offline. The maximum time to live supported is 4 weeks, and the default value is 4 weeks. For more information, see Setting the lifespan of a message.

like image 115
AL. Avatar answered Sep 23 '22 17:09

AL.