IOS App Launch Option, ioslaunch
When the iOS program starts, it always calls application: didfinishlaunchingwitexceptions:. The second parameter launchOptions is an object of the NSDictionary type, which stores the reason for the program to start.
For possible key values in launchOptions, see the Launch Options Keys section of the UIApplication Class Reference.
1. If the user starts it directly, there is no data in lauchOptions;
2. If other applications start through openURL:UIApplicationLaunchOptionsURLKeyThe corresponding object is the startup URL (NSURL ),UIApplicationLaunchOptionsSourceApplicationKeyCorresponding to the bundle ID (NSString) of the started source application );
3. If a local notification is enabledUIApplicationLaunchOptionsLocalNotificationKeyIt corresponds to the local notification object (UILocalNotification) that starts the application );
4. If a remote notification is enabledUIApplicationLaunchOptionsRemoteNotificationKeyIt corresponds to the remote Notification Information userInfo (NSDictionary) that starts the application );
5. other keys includeUIApplicationLaunchOptionsAnnotationKey,UIApplicationLaunchOptionsLocationKey,UIApplicationLaunchOptionsNewsstandDownloadsKey.
If you want to make some distinction at startup, you need to process the following code. For example, your application can be called by another application (as a sub-Application of the Application). To achieve single-point logon, you must make a reasonable verification at the startup code, and skip logon.
Java code
-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions
{
NSURL * url = [options objectForKey: UIApplicationLaunchOptionsURLKey];
If (url)
{
}
NSString * bundleId = [options objectForKey: UIApplicationLaunchOptionsSourceApplicationKey];
If (bundleId)
{
}
UILocalNotification * localNotify = [options objectForKey: UIApplicationLaunchOptionsLocalNotificationKey];
If (localpolicy)
{
}
NSDictionary * userInfo = [options objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];
If (userInfo)
{
}
}