Skip to content

Commit

Permalink
fix(push-notifications): proper return of push notification object pr…
Browse files Browse the repository at this point in the history
…operties (#349)
  • Loading branch information
theproducer committed Apr 19, 2021
1 parent ab1d157 commit 733fc06
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions push-notifications/ios/Plugin/PushNotificationsHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,14 @@ public class PushNotificationsHandler: NSObject, NotificationHandlerProtocol {

}

func makeNotificationRequestJSObject(_ request: UNNotificationRequest) -> JSObject {
let notificationRequest = notificationRequestLookup[request.identifier] ?? [:]
func makeNotificationRequestJSObject(_ request: UNNotificationRequest) -> JSObject {
return [
"id": request.identifier,
"title": request.content.title,
"sound": notificationRequest["sound"] ?? "",
"subtitle": request.content.subtitle,
"badge" : request.content.badge ?? 1,
"body": request.content.body,
"extra": JSTypes.coerceDictionaryToJSObject(request.content.userInfo) ?? [:],
"actionTypeId": request.content.categoryIdentifier,
"attachments": notificationRequest["attachments"] ?? []
"data": JSTypes.coerceDictionaryToJSObject(request.content.userInfo) ?? [:],
]
}
}

0 comments on commit 733fc06

Please sign in to comment.