0

i am developing a push notificacftion system with GCM. I have seen that all the notifications dissappear after x seconds.

How can i do to make them permanent until the users clicks it or close it?

Dani
  • 141
  • 1
  • 5

1 Answers1

0

You can use the time_to_live parameter, to specify the maximum lifespan of a message. The value of this parameter must be a duration from 0 to 2,419,200 seconds, and it corresponds to the maximum period of time for which GCM will store and try to deliver the message.

Check this documentation to know the different parameters that you can set in your GCM.

Also,Check this link and SO question for more information.

Community
  • 1
  • 1
KENdi
  • 7,576
  • 2
  • 16
  • 31
  • but this is to specify the time that the push notification will be stored in the servers if the computer is offline. I am looking for another thing... Now when i send a push, this push dissappear after x seconds, it should have to be fixed until the user click on it – Dani Aug 09 '16 at 13:11
  • Just for confirming, you only use GCM for web? not on android or IOS? I really like to help you, but all information that I see about this is always for android. I'm still looking for other information that can help this problem. – KENdi Aug 10 '16 at 01:27
  • yes, only for web. I am having the same problem, all the info is for android, for web there are a pair of examples and thats it. – Dani Aug 10 '16 at 07:03
  • this is a live example of gcm for web. https://gauntface.github.io/simple-push-demo/ , if you use it on desktop the push disappear, but in mobile no – Dani Aug 10 '16 at 12:43