Unexpected operation found. Details are below:
Conditions and configurations used in the testing:
- "Background Modes" Capability with "Location updates" checked on
- Added the info.plist keys: NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription with description
- Monitoring for several beacon regions and invoking startMonitoringSignificantLocationChanges using core location API
- My app's location authorization status set 'Always'
- Added UserNotification in func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool , so that a notification could be triggered in AppDelegate method when an application is launched.
How I tested
Given the condition above applied, I have closed my application by force using "swiping up in the app-switcher screen"
What I expected
I have been convinced that "close-by-force" triggers the removal process of the target application(my app) from the memory. And it stays so until it is relaunched by the system given the specific location-related events - such as entering into registered beacon region or moving over 500-meter(significant locations changes).
What I actually found
I have discovered that in some versions of iOS, specifically iOS 15.3 and iOS 15.3.1, my application was relaunched immediately and automatically as soon as the app was closed(close-by-force). No beacon enter or moving over 500-meter events are involved. This unexpected relaunching issue was not found in the other version of iOS. I have tested eleven devices that are using iOS 10.3.3 ~ 15.1.
What I want to know
I am wondering if this relaunching case in iOS 15.3 and 15.3.1 is an unexpected bug or not. In addition, I also want to know why it is working differently between iOS versions.
Thanks for your help in advance.