Skip to content

Commit

Permalink
Merge pull request #10 from AvayaExperiencePlatform/feature/apns-support
Browse files Browse the repository at this point in the history
Added mutable-content to the payload for iOS devices
  • Loading branch information
saumabhapal authored Aug 2, 2024
2 parents 9799f2e + da41694 commit 36eca47
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sample-fcm-push-notification-server/routes/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ var getSessionDeviceMap = () => { return dataServices.getSessionDeviceMap(); };

var fcmAdminApp = config.fcmAdminApp;
notification.message.token = deviceToken;

// Add mutable-content to the payload for iOS devices
let deviceData = getDeviceConfigMap().get(deviceToken);
if(deviceData.type && 'ios' === deviceData.type.toLowerCase()){
var t = new Date().getTime();
notification.message.notification = {
title: "title " + t,
body: "body " + t,
};
notification.message.apns =
{
payload: {
aps: {
"mutable-content": 1
}
}
};
}

if (!fcmAdminApp) {
// Initialize firebase and save it in the config
Expand Down

0 comments on commit 36eca47

Please sign in to comment.