Skip to content

Commit

Permalink
fix: undelivered background data message ios (invertase#4144)
Browse files Browse the repository at this point in the history
A temporary fix until a better solution is implemented.
  • Loading branch information
compojoom authored Aug 26, 2020
1 parent fa84379 commit d75282b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/RNFBMessaging/RNFBMessaging+AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
// TODO investigate later - RN bridge gets invalidated at start when in background and a new bridge created - losing all events
// TODO so we just delay sending the event for a few seconds as a workaround
// TODO most likely Remote Debugging causing bridge to be invalidated
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[RNFBRCTEventEmitter shared] sendEventWithName:@"messaging_message_received_background" body:[RNFBMessagingSerializer remoteMessageUserInfoToDict:userInfo]];
});
} else {
Expand Down

0 comments on commit d75282b

Please sign in to comment.