Can I open my app form an iOS8 share extension? I'm working on a hybrid app & I want the user to be able to share photos from my app using iOS8 share extension.
-
I don't have a long form answer for you because I didn't try it yet, but if you are comfortable with Objective-C you can open your Hybrid app in XCode and do everything a native app can do (including share extensions). What version of WL are you using? – Nathan H Oct 13 '14 at 07:19
-
I'm using WL 6.1. The problem is I'm not sure it's possible/how to open the application's ViewController/Xid from an extension. – MElkady Oct 13 '14 at 17:10
-
@MElkady Were you able to get this to work? Could you share a few pointers? – momo Nov 21 '14 at 02:33
3 Answers
AFAIK Work light is not providing any features that support share extensions from iOS. You should write some native code in xCode using objective C or swift

- 3,438
- 3
- 18
- 31
I managed to get it done by:
1- Register a custom scheme to your app (for ex: mak://...)
2- Register an app group so the app can use the file used by the share extension
3- Create your own share dialog by extending UIViewController & embed a tiny webview in it
4- After performing checking for the shared item, load the web view with a request using the app's custom scheme (ex: self.webView.loadRequest("mak://share/file/"))

- 163
- 10
-
-
1Unfortunately, seems that Apple disabled this in iOS 8.2. The original idea was replacing the default share dialog with another custom dialog by making the share view controller class extends UIViewController. In the storyboard you'll need to add a web view like any other iOS app. – MElkady Jun 16 '15 at 06:54
Here is how I implemented a clipper for a Cordova app.
Cordova: sharing browser URL to my iOS app (Clipper ios share extension)
I do not send pictures to my app, but urls instead.
I agree with MElkday's answer: you have to use a way to share that image to your app.
Some solutions include: - Upload the picture to a backend and send the url to your app. - Use App Groups and probably things like NSUserDefaults (see link) so share a local url to your app, and use a Cordova plugin to load the file at that local url.
See also this cordova plugin

- 1
- 1

- 89,644
- 67
- 288
- 419