iOS Sharing Extension

332 views
Skip to first unread message

Sébastien Lorber

unread,
Dec 3, 2015, 7:06:24 AM12/3/15
to phonegap
Hey,

I have been able to create a Share Extension for iOS 8 for a Cordova / Phonegap project.

I don't think it's possible to do that with PhonegapBuild but if someone is interested here's link:

Kerri Shotts

unread,
Dec 3, 2015, 10:15:48 AM12/3/15
to phonegap
Nice.

Consider making this a regular plugin, if you can. And publish to NPM. Then PhoneGap Build could use it too.

Ideally, you'd want this to be installable via the CLI (cordova plugin install your-plugin-id).

Sébastien Lorber

unread,
Dec 3, 2015, 12:14:04 PM12/3/15
to phon...@googlegroups.com
Kerri the thing is it is kind of impossible to make a plugin.

I tried and found no solution, as written in my answer you really need to use XCode at some point...

I've open a Cordova issue about that but I don't think they will be able to find a solution to this easily...

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to a topic in the Google Groups "phonegap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phonegap/yYehp-45CCY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jesse Monroy

unread,
Dec 4, 2015, 11:13:25 PM12/4/15
to phonegap
@Sébastien,

It understandable that sometimes people get lost working on Cordova and Phonegap. The documentation is bad and often confusing. However, the volunteers that work the forums feel there is much to offer, once developers get past some of the shortcomings.

1) There are many "sharing" extensions written as plugins. You can always find them using the Plugin Repository. I happen to six at this moment.

The most popular plugin being eddy verbruggen's cordova-plugin-x-socialsharing

2) All plugins eventually have to use "Native" code to accomplish task. Until Javascript has it's own "typed" language, JS will have to depend on native implementations for plugins. We have great hope for TypeScript. But we are patient also.

3) Make you extension would still be valuable, as sometimes the details of an extension make them a favorite for developers. If you feel inclined you can use the Cordova Plugin Development Guide to help you make the correct modifications. In addition, *Phonegap Build* has abandoned the previous requirement to be listed on the Phonegap Build Repository. The current policy is that anything available on the Cordova Plugin Repository is available for use with Phonegap Build.

Best of Luck
Jesse

Sébastien Lorber

unread,
Dec 5, 2015, 7:28:45 AM12/5/15
to phon...@googlegroups.com
Jesse all the plugins you mention permit a cordova app to share something to other apps (like sharing content from your app to Facebook or Twitter)

In my case an iOS share extension permits to receive content from the other app (like a Pocket / Evernote clipper)


In the famous "socialsharing" plugin, you can only share content and not receive shared content, there's an unresolved issue about that and the author tells himself that it's complicated to do so for iOS:
 "You're right, it is possible but it's a lot harder than on Android"

See this issue:



I have successfully implemented a plugin to receive sharing for Android here: https://github.com/stample/cordova-sharingreceptor

I tried to make the plugin work for iOS but figured out it was simply impossible to do that as a plugin for the iOS platform because cordova plugins do not permit to do the modifications we need in the iOS platform. If you read my iOS stackoverflow you will understand why.

The only way would to to contribute to cordova core itself so that it permits to register a share extension, but it is a lot of work and reverse engineering of the ios xproj file... complicated, error-prone (because the xproj file format changes with xcode versions) and time consuming work that I can not handle right now.

Jesse Monroy

unread,
Dec 5, 2015, 3:48:19 PM12/5/15
to phonegap
On Saturday, December 5, 2015 at 5:28:45 AM UTC-7, Sébastien Lorber wrote:
::::SNIP::::
I tried to make the plugin work for iOS but figured out it was simply impossible to do that as a plugin for the iOS platform because cordova plugins do not permit to do the modifications we need in the iOS platform. If you read my iOS stackoverflow you will understand why.

The only way would to to contribute to cordova core itself so that it permits to register a share extension, but it is a lot of work and reverse engineering of the ios xproj file... complicated, error-prone (because the xproj file format changes with xcode versions) and time consuming work that I can not handle right now.


@Sébastien,
Thanks for your response. On this plugin, I have very little interest, but thank you for make the source available.

My message to you was in the hope of encouraging you to make it a plugin.  I understand the work can be time-consuming. Best of Luck.

Thanks again
Jesse


Reply all
Reply to author
Forward
0 new messages