Skip to content

Commit

Permalink
Adding simple API support for .data
Browse files Browse the repository at this point in the history
  • Loading branch information
danjoa committed Oct 26, 2023
1 parent ab7bb8f commit 193e990
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ function buildDefaultNotification(
}

function buildCustomNotification(notificationData) {
let { payload={}, navigation={} } = notificationData
return {
let { payload={}, navigation={}, data } = notificationData
let notification = {
Id: payload.Id,
OriginId: payload.OriginId,
NotificationTypeId: payload.NotificationTypeId,
Expand All @@ -176,6 +176,10 @@ function buildCustomNotification(notificationData) {
Properties: notificationData.properties,
TargetParameters: payload.TargetParameters
}
if (data) notification.Properties = Object.entries(data).map(([ Key, Value ]) => ({
Key, Value, // Language: "en", Type: "String", IsSensitive: false
}))
return notification
}

function buildNotification(notificationData) {
Expand Down

0 comments on commit 193e990

Please sign in to comment.