Significant Delay in IOS setBackgroundMessageHandler #4528
-
I am experiencing an 8+ second delay from the time the notification is received on the device to when the background message handler is fired. I've tried removing bits of code one by one to see where my problem lies but I still haven't resolved this. Here is my index.js
Even with this heavily reduced file, I am still experiencing an 8 or so second delay. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Open it in Xcode, do a release mode build on a real device, then watch it using Xcode profiling tools to see where you are spending time in native code boot. Without seeing in package.json what other items are present it's impossible to know what native code is being loaded + run despite seeing the javascript here |
Beta Was this translation helpful? Give feedback.
-
Drive by comment but the 8 second delay comes from this; https://github.com/invertase/react-native-firebase/blob/master/packages/messaging/ios/RNFBMessaging/RNFBMessaging%2BAppDelegate.m#L135 This was added in #4144 due to #4104 - added in favor of working all the time but with a delay vs not working 'some of the time'. A better solution does need implementing along the lines of what I mentioned in #4104 (comment) - JS needs to tell native that it's ready for the events (it does actually already do this currently so something else there is not working as intended). |
Beta Was this translation helpful? Give feedback.
Drive by comment but the 8 second delay comes from this; https://github.com/invertase/react-native-firebase/blob/master/packages/messaging/ios/RNFBMessaging/RNFBMessaging%2BAppDelegate.m#L135
This was added in #4144 due to #4104 - added in favor of working all the time but with a delay vs not working 'some of the time'.
A better solution does need implementing along the lines of what I mentioned in #4104 (comment) - JS needs to tell native that it's ready for the events (it does actually already do this currently so something else there is not working as intended).