App quits right after it is launched from home screen

We have an social networking app uploaded on the App Store.


When you click on the app icon from the home screen it launches for less than a second and then goes away.The app is visible when you double-click the Home button to see the recently used apps.


This is happening when the app is distributed using Mobile Device Management purchased through the Volume Purchase Plan. This is happening with a few devices but it works fine when directly downloaded from the app store. Recently, after upgrading the devices to the latest iOS version the problem started appearing on all MDM managed devices.


We have tried a number of things to figure out the problem. We tried restart the device. We made sure that the devices are using latest version of iOS. We even tried installing another free app from the App Store.


After going through a lot of forums we suspected that the applicationdidFinishLaunchingWithOptions might be taking sometime due to which system might kill the app before it even got to present the first view.


Fetching saved userId from keychain. If no userId creating new one, Firebase Initialisation, Branch.io Initialization (https://dev.branch.io/getting-started/sdk-integration-guide/guide/ios/#configure-xcode-project), Crashlytics Initialisation,Adding observers for reachability changes, Register for remote notification settings

Crash log : https://docs.google.com/document/d/1FVtY9J-ycRMs9wDQNzxLPZCN_Ikr6uc-909WgtVfmUc/edit?usp=sharing

Similar here, but even worse!

We are having more and more users who have the same issue after any kind of updates (os updates as well as app updates). The app shows the launch screen and then quits, no even calling didFinishLaunching.

In same cases, the workaround is to send the app to icloud (offload) and then restart it, restoring all data from the cloud. Unfortunately, this worked fine in iOS 13 but does not always work in iOS 14.0.

Currently, the only way to make the app work again is to delete and reinstall it, letting the user lose all of the data assign to the app. THIS IS A DESASTER for most of our users.

We URGENTLY need a solution.
App quits right after it is launched from home screen
 
 
Q