Commit b9bfcc6f authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Trying to set ttl to 0 to fix push not received

parent 2ab1e828
Pipeline #6898 passed with stages
in 43 minutes and 17 seconds
......@@ -19,8 +19,11 @@ FirebasePushNotificationRequest::FirebasePushNotificationRequest(const PushInfo
const string &from = pinfo.mFromName.empty() ? pinfo.mFromUri : pinfo.mFromName;
ostringstream httpBody;
string date = getPushTimeStamp();
httpBody << "{\"to\":\"" << deviceToken << "\", \"priority\":\"high\""
int ttl = (pinfo.mEvent == PushInfo::Call) ? 0 : 2419200; // 4 weeks, it is the maximum allowed TTL for firebase push
httpBody << "{\"to\":\"" << deviceToken << "\", "
<< "\"time_to_live\": " << ttl << ", "
<< "\"priority\":\"high\""
<< ", \"data\":{"
<< "\"uuid\":" << quoteStringIfNeeded(pinfo.mUid)
<< ", \"call-id\":" << quoteStringIfNeeded(pinfo.mCallId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment