Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save actuosus/f24b18d89bce6da94441dbf9172b899e to your computer and use it in GitHub Desktop.
Save actuosus/f24b18d89bce6da94441dbf9172b899e to your computer and use it in GitHub Desktop.
React Native Firebase Messaging Patch to use with patch-package when `mutable-content` is number or string
diff --git a/node_modules/@react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m b/node_modules/@react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m
index 18d69d9..8685051 100644
--- a/node_modules/@react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m
+++ b/node_modules/@react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m
@@ -113,7 +113,7 @@ + (NSDictionary *)remoteMessageUserInfoToDict:(NSDictionary *)userInfo {
}
// message.mutableContent
- if (apsDict[@"mutable-content"] != nil && [apsDict[@"mutable-content"] isEqualToString:@"1"]) {
+ if (apsDict[@"mutable-content"] != nil && [apsDict[@"mutable-content"] intValue] == 1) {
message[@"mutableContent"] = @([RCTConvert BOOL:apsDict[@"mutable-content"]]);
}
@leviduan
Copy link

Yes, change it, I can sent the push notification to every one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment