28
Views
5
Comments
How to set "Expires" time to Firebase SendNotificationToTopic properties?
Question

Outsystems 11
Plugin: FirebaseMiddleware


I am trying to send reminder notifications to user everyday, but it seems that if user does not open app, user will get multiple notifications. I do not use separate notifications for each user, because user does not have to login to application. That is why I am using SendNotificationToTopic-method.

So is it possible to set this "Expires" option, which is available in Firebase console?

2023-01-04 05-10-52
Akshay Puri

Hi Jay,

That is called TTL, time to live, property in android context and can be set through customization to the plugin unless I missed an input parameter already available for the plugin. Here are the details if you want to understand more about it: 

https://firebase.google.com/docs/cloud-messaging/concept-options#ttl

2020-07-01 06-38-14
Jukka Pekka Patrikainen

Akshay Puri wrote:

Hi Jay,

That is called TTL, time to live, property in android context and can be set through customization to the plugin unless I missed an input parameter already available for the plugin. Here are the details if you want to understand more about it: 

https://firebase.google.com/docs/cloud-messaging/concept-options#ttl

Thank you for pointing that correct attribute:

    "android":{
      "ttl":"4500s"
    },
    "webpush":{
      "headers":{
        "TTL":"4500"
      }
    }

Any idea where that TTL parameter should be set in FirebaseMiddleware method call?


2023-01-04 05-10-52
Akshay Puri

I think you will have to add the additional structure attribute in the request to send this through like:

2020-07-01 06-38-14
Jukka Pekka Patrikainen

Akshay Puri wrote:

I think you will have to add the additional structure attribute in the request to send this through like:

Is it supported only for Android or is there a support for iOS also?

I was thinking that does it work, if add that "ttl" and e.g. "86340s" in ExtraData variable and add it in ExtraDataList as item


2023-01-04 05-10-52
Akshay Puri

Hi Jay,

  1. If you observe in SendNotification_Android, all the pairs from ExtraData are getting appended to Data just before the rest api is called, so I am not sure if that will create a correct structure.
  2. This is the structure for iOS, you will have to add one more structure parallel to android
"apns":{
      "headers":{
        "apns-expiration":"1604750400"
      }
    }
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.