I am working on a mobile clipper. When in a galery app, I want to be able to send a picture to my app. When in the browser, I want to be able to send the current url to my app.
Note: I'm already aware that I should add a CFBundleDocumentTypes
to the plist file so that my app appears in the list of apps to which I can send data (see also
How do I associate file types with an iPhone application?)
So when the "share" action is triggered while my app is not started, I can listen to application:didFinishLaunchingWithOptions
and then extract the data from the launch options.
But when my app is already started and is in background, and I share an image or an url to it, obviously the didFinishLaunchingWithOptions
will not trigger so I won't be able to get a dictionnary to which I can get my data.
See approved comment in original answer:
it should be noted that -application:didFinishLaunchingWithOptions: in the app delegate is only called if your app was not backgrounded when it's opened to handle a file.
So, how can I handle both cases: when my app was in background and is made active, and when my app was simply started?
Sorry if this question is dumb as I'm not a iOS dev at all and trying to do my first cordova plugin.
My app should be compatible with at least iOS 7.