iphone - ios determine how an app is launched -


is there way determine "how" app launched or made active (i.e. homescreen tap, 4 finger swipe, siri, etc...)?

there's thread similar (determining whether ios application launched via siri), not many answers in this. there's mac osx (how can mac app determine method used launch it?) need similar ios.

i've skimmed through (https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/managingyourapplicationsflow/managingyourapplicationsflow.html#//apple_ref/doc/uid/tp40007072-ch4-sw3) though coudn't find recognizes "how" app launched.

thanks in advance.

you can figure out app launched url in application using appdelegate method:

- (bool)application:(uiapplication *)application             openurl:(nsurl *)url   sourceapplication:(nsstring *)sourceapplication          annotation:(id)annotation { }  

additionally, application:didfinishlaunchingwithoptions: has options, keys can find here tell reasons why app launched.

those keys are:

nsstring *const uiapplicationlaunchoptionsurlkey; nsstring *const uiapplicationlaunchoptionssourceapplicationkey; nsstring *const uiapplicationlaunchoptionsremotenotificationkey; nsstring *const uiapplicationlaunchoptionsannotationkey; nsstring *const uiapplicationlaunchoptionslocalnotificationkey; nsstring *const uiapplicationlaunchoptionslocationkey; nsstring *const uiapplicationlaunchoptionsnewsstanddownloadskey; nsstring *const uiapplicationlaunchoptionsbluetoothcentralskey; nsstring *const uiapplicationlaunchoptionsbluetoothperipheralskey; 

you can check them if statements when app launches.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -