TestFlight Crash - exhausted real (wall clock) time allowance
Bug report
Summary
When a version of the app is delivered via TestFlight and when a background push is sent to the device it receives a crash alert. On some investigation the app is being killed by iOS and the following information is in the logs.
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, scene-create watchdog transgression: application<****>:7778 exhausted real (wall clock) time allowance of 19.56 seconds
Environment info
react-native info output:
System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
Memory: 114.65 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.7.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_232 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Library version: 1.2.0
Steps to reproduce
- Kill the app
- Send a content-available push notification.
- Device displays a TestFlight crash alert
Describe what you expected to happen:
I am expecting the app to launch silently in the background and process the background notification event
I'm not super into it, just read over your issue, did you maybe forget to call finish on the notification? Like it is described here https://github.com/react-native-community/push-notification-ios#finish
I think it was a mix of that and using React-Native-SplashScreen which I was still initiating if the app was in background. Think the finishLoadingWithOptions was a bit overloaded
Just a short unrelated question, what happens if you swipe the app away, do you still receive remote notifications?
No I don't, which is a bit of an issue. As I rely on remote background notifications to post a keep alive to the server
Ok damn :( so the app does not receive anything from the moment its swiped away, if I find a solution/the cause I'll post it here
I just investigated a bit, my native code does not even get called, when I send the push. So for some reason apple does not call the didReceiveRemoteNotification
Oh wow reading the docs helped: 'In addition, if you enabled the remote notifications background mode, the system launches your app (or wakes it from the suspended state) and puts it in the background state when a remote notification arrives. However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again. .' https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application
So I guess sending remote notifications is not possible if the user killed the app manually, but if the system kills the app due to low memory, or whatever reason its started again
Yea I pretty much got to the conclusion that it wasn't possible. Which then I looked at background fetch to trigger my keep-alive to the server but that was unreliable too.