microsoftconnect / ms-intune-app-sdk-ios

Intune App SDK for iOS enables data protection and mobile app management features in iOS mobile apps with Microsoft Intune
89 stars 25 forks source link

application:didFinishLaunchingWithOptions possibly not getting called or Intune conflict with Firebase #458

Closed JonathanFuentesF closed 2 weeks ago

JonathanFuentesF commented 1 month ago

Describe the bug: Hi! We've been receiving crash reports from our users that the application immediately crashes after installing Intune policies and app restart, after that... user's can't open app.

This is only affecting some users, app works as expected for everyone else. We are unable to reproduce the issue on our end, tested with multiple devices, accounts.

Notes of investigation: The corresponding crash report shows that application is crashing because we are trying to use firebase remote configuration before being initialized which is done in App Delegate (FirebaseApp.configure())

The first usage of Firebase SDK is in view did load method of the initial view controller of the application which is setup using plist key "Main storyboard file base name"

What are the odds that the view controller is initialized before app did finish launching with options ? or that app did finish launching with options is skipped all together?

This is a UIKit application, we are not using Scene Delegate.

We did a test removing usage of RemoteConfiguration in the app and the app is not crashing anymore for our affected users.

Not sure if this means anything but all reports are from PRO and PRO MAX devices.

To Reproduce Steps to reproduce the behavior:

  1. Go trough the login flow
  2. Intune install policies
  3. App Restarts
  4. App immediately crashes after opening.

Expected behavior: App Doesn't crash after installing policies restart.

Screenshots and logs:

Intune App SDK for iOS (please complete the following information):

wangxiaoms commented 1 month ago

Hi can you get the crash report, ips file, send to me wangxiao@microsoft.com https://developer.apple.com/documentation/xcode/diagnosing-issues-using-crash-reports-and-device-logs

JonathanFuentesF commented 1 month ago

@wangxiaoms report has been sent.

wangxiaoms commented 1 month ago

As discussed via email please add IntuneMAMSettings with related paramters.

wangxiaoms commented 2 weeks ago

As discussed in email I'm closing the issue.

We are not able to reproduce our error internally so not sure if it works, affected users were provided a build that moves Firebase initialization after appDidFinishLaunchingwithOptions and this worked even though I prefer your solution as a fix to be able to return Firebase initialization back to its original place.

It is not possible for us to do testing with affected users since it is production so I guess we can mark the issue as fixed. We’ll include your solution (FinishLaunchingAtStartup to true in Info.plist) anyway just in case.