Upgrading and exiting

We are running a Xamarin/Maui iOS app. The syntax I post will be different from Swift or other languages, but the underlying logic and issues should be the same. Since our app is only for employees, we do not want it on the app store. Until now, we've used Microsoft's AppCenter to distribute our app. AppCenter is being retired.

We are trying to follow the "Distribute proprietary in-house apps to Apple devices" guide at https://support.apple.com/guide/deployment/distribute-proprietary-in-house-apps-depce7cefc4d/web. This is working well so far from a web page for installs, but we want our app itself to prompt users to upgrade.

We can call await Launcher.OpenAsync(url) with the manifest to install upgrades, however this gives users the option to cancel. If a user cancels, we do not want them to be able to use the old version. My understanding is Apple recommends against apps exiting themselves, which has been a problem for us in other situations users should not be able to continue as well. Providing a page explaining they cannot continue unless they upgrade, or giving them the option to try again is acceptable; however I cannot figure out any way to hook into the event for this dialog to bring this page up at the correct time.

If we go against Apple's advice and close the app, calling Thread.CurrentThread.Abort() immediately after await Launcher.OpenAsync(url) seems to work, both for users who continue and users who cancel. I am wondering if anyone has an alternative - we cannot be the only one distributing an in-house app that upgrades itself.

Replies

A thought would be to display an alert with no buttons explaining to the user what is going on. That blocks the ui without terminating the app.