Skip to content

Instantly share code, notes, and snippets.

@bezysoftware
Created March 13, 2017 09:33
Show Gist options
  • Select an option

  • Save bezysoftware/2fe86d83ca623c98764cddef056d0a34 to your computer and use it in GitHub Desktop.

Select an option

Save bezysoftware/2fe86d83ca623c98764cddef056d0a34 to your computer and use it in GitHub Desktop.
function createRawPayload(userName: string, groupName: string, groupId: string, change: Change)
{
let payload =
{
data:
{
"by" : userName,
"action" : change.action,
"entity" : change.entity,
"groupId" : groupId,
"groupName" : groupName
}
};
return payload;
}
function createIosPayload(userName: string, groupName: string, change: Change)
{
let payload =
{
body_loc_key : `notification_body_${change.entity}_${change.action}`,
body_loc_args : [ userName, change.entityName ],
title_loc_key : 'notification_title',
title_loc_args : [ groupName ]
};
return payload;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment