Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 7c5ac1d

Browse files
authored
Merge pull request #1474 from lukebars/patch-1
Add notification id to iOS if userInfo doesn't exist
2 parents 6bcc2a9 + 5994754 commit 7c5ac1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ Notifications.localNotification = function(details) {
160160

161161
if (details.userInfo) {
162162
details.userInfo.id = details.userInfo.id || details.id;
163+
} else {
164+
details.userInfo = {id: details.id};
163165
}
164166

165167
// for valid fields see: https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html
@@ -228,6 +230,8 @@ Notifications.localNotificationSchedule = function(details) {
228230

229231
if (details.userInfo) {
230232
details.userInfo.id = details.userInfo.id || details.id;
233+
} else {
234+
details.userInfo = {id: details.id};
231235
}
232236

233237
const iosDetails = {

0 commit comments

Comments
 (0)