Skip to content

Commit

Permalink
fix(messaging): Refactor code to avoid bugs
Browse files Browse the repository at this point in the history
When NotificationIOS only contains badge, it's not serialized... So I fixed it
  • Loading branch information
Titozzz authored and mikehardy committed Jul 7, 2021
1 parent 2c44281 commit 5039759
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ + (NSDictionary *)remoteMessageUserInfoToDict:(NSDictionary *)userInfo {
notificationIOS[@"subtitleLocArgs"] = apsAlertDict[@"subtitle-loc-args"];
}
}

notification[@"ios"] = notificationIOS;
message[@"notification"] = notification;
}

// message.notification.ios.sound
Expand Down Expand Up @@ -208,11 +205,14 @@ + (NSDictionary *)remoteMessageUserInfoToDict:(NSDictionary *)userInfo {
// message.notification.ios.sound
notificationIOS[@"sound"] = notificationIOSSound;
}

notification[@"ios"] = notificationIOS;
message[@"notification"] = notification;
}
}
if ([notificationIOS count] > 0) {
notification[@"ios"] = notificationIOS;
}
if ([notification count] > 0) {
message[@"notification"] = notification;
}

return message;
}
Expand Down

1 comment on commit 5039759

@vercel
Copy link

@vercel vercel bot commented on 5039759 Jul 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.