IOS App Launch Option (click to push Action)

Source: Internet
Author: User

The possible key values in Launchoptions are shown in the Launch Options keys section of uiapplication Class reference.

  • If the user launches directly, no data in the lauchoptions;
  • If it is started by another application through OpenURL: Uiapplicationlaunchoptionsurlkey, the corresponding object is the startup URL (nsurl), Uiapplicationlaunchoptionssourceapplicationkey the bundle ID of the source application that corresponds to the startup (NSString);
  • If initiated by a local notification, the Uiapplicationlaunchoptionslocalnotificationkey corresponds to the local notification object (uilocalnotification) for the startup application;
  • If initiated by a remote notification, the Uiapplicationlaunchoptionsremotenotificationkey corresponds to the remote notification information userinfo (nsdictionary) that initiates the application;
  • Other keys also have Uiapplicationlaunchoptionsannotationkey,uiapplicationlaunchoptionslocationkey, Uiapplicationlaunchoptionsnewsstanddownloadskey.
The code distinguishes between different launches, such as click-to-push to make jumps
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions{    Nsurl *url = [options Objectforkey:uiapplicationlaunchoptionsurlkey];    if (URL)    {    //by another application via OpenURL: Boot    }    nsstring *bundleid = [Options Objectforkey: Uiapplicationlaunchoptionssourceapplicationkey];    if (Bundleid)    {    //The bundle ID of the source application that corresponds to launch (nsstring)    }    uilocalnotification * localnotify = [options Objectforkey:uiapplicationlaunchoptionslocalnotificationkey];    if (localnotify)    {    //click on local push in after    }    nsdictionary * userInfo = [Options Objectforkey: Uiapplicationlaunchoptionsremotenotificationkey];    if (userInfo)    {     //Click to push in after    }}


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

IOS App Launch Option (click to push Action)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.