Thank you Kevin,
Regarding Bugsnag initialization, we start it in applicationDidFinishlaunching on the main thread and given our launch times from Xcode organizer (around 1 second 90% and around 0.5 second 50%) and users never complaining of having long start times I don't see how it could take that much longer time than normally it does (sub 100ms).
Regarding using notification to test the behavior, the idea is nice, but the slight problem is that it requires somebody closely watching the phone to quickly react to unpredictable background fetch event. I was testing it before and setting to the be triggered as quickly as possible, but usually it was hours of waiting for it to occur after backgrounding the app. Is there a way to force triggering it earlier? The only way I'm able to trigger background fetches (except when running the app via Xcode) is on my jailbroken device by attaching the debugger to DASDaemon and executing forceRunActivities however I think it won't work when the device is locked.
We also never saw those early expirations during development or beta testing, they are not in large percentage, but the number of events is not small. It's that we just waste users and our server resources because of those quick expirations.
Regarding the Does the system let you track issues by device, even though the device itself is anonymous? the data is very limited (e.g. language, app version, compiler version, thread stack trace), it's way less than in organizer crash logs.
So before I close the thread, please confirm that those steps are correct:
call scheduleAppRefresh() in applicationDidEnterBackground(_: UIApplication)
call scheduleAppRefresh() in the handleAppRefresh directly like in the Apple's documentation and in the code snipped I provided.
Lastly, is there a way to know if the app was launched due to the app refresh? If we know that we can avoid a lot of unnecessary initializations.
Thank you!