Commit 7ca8dc84 authored by Simon Morlat's avatar Simon Morlat

Add caller identity (from) to Firebase notifications too.

parent e7adf525
Pipeline #5770 passed with stages
in 20 minutes and 54 seconds
......@@ -7,15 +7,22 @@
using namespace std;
using namespace flexisip;
/*
* This supports the legacy http Firebase protocol:
* https://firebase.google.com/docs/cloud-messaging/http-server-ref
*/
FirebasePushNotificationRequest::FirebasePushNotificationRequest(const PushInfo &pinfo)
: PushNotificationRequest(pinfo.mAppId, "firebase") {
const string &deviceToken = pinfo.mDeviceToken;
const string &apiKey = pinfo.mApiKey;
const string &from = pinfo.mFromName.empty() ? pinfo.mFromUri : pinfo.mFromName;
ostringstream httpBody;
string date = getPushTimeStamp();
httpBody << "{\"to\":\"" << deviceToken << "\", \"priority\":\"high\"" << ", \"uuid\":" << quoteStringIfNeeded(pinfo.mUid)
<< ", \"call-id\":" << quoteStringIfNeeded(pinfo.mCallId)
<< ", \"from\":" << quoteStringIfNeeded(from)
<< ", \"send-time\":\"" << date << "\"}";
mHttpBody = httpBody.str();
LOGD("Push notification https post body is %s", mHttpBody.c_str());
......
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