1

I am searching for the last week over many websites, and I can see people with the same question, but they are mostly misundestood.

What I have: I have an iOS application that can receive URL from browsers (made with ionic/cordova)

What I want: When I am on Safari (or other browser), i want to use the button Share, and my app appear there, in the list, just like Twitter, Facebook, etc. (I put an arrow in the image below).

Like this:

app sharing button

And, I want this working on many iOS versions.

So, I tried to change my app-info.plist many times and nothing works.

Somebody have a solution for this? Somebody have a info.plist that do this job?

(PS: I don´t want to use URL scheme, links, etc... Its the browser SHARE)

Thanks!

pierre
  • 49
  • 6
  • You need to look into iOS extensions. Now, how do you do that with Cordova? I do not know. BTW, you should really to native. – Ares Dec 15 '15 at 01:42
  • @Ares, I am already using the Xcode to deploy the cordova project. But I don´t know how to do. Share Extension is the answer? Nothing more simple to just share URLs? – pierre Dec 15 '15 at 14:41

1 Answers1

1

The only way is to create a share extension, as mentioned. It is not a trivial task in that you have to incorporate a lot of pieces together to make it work. Also, it is only supported on iOS 8+, which I guess shouldn't be a major issue at present.

In a nutshell:

  1. Create Share Extension in XCode
  2. Create a JS preprocessor
  3. Add plist key/value pairs for related ExtensionAttributes
  4. Set up custom URL scheme
  5. Customize ShareViewController
  6. Set up global handler function to perform your desired actions in app

See Cordova: sharing browser URL to my iOS app (Clipper ios share extension)

Or https://www.inshikos.com/blogs/76/dev/link-and-photo-sharing-to-a-cordova-ios-app-via-share-extensions-ios-8 that expands it further to include photo and wider share scenarios.

And, yes, a terribly misunderstood question with many false positive answers in other posts.

Community
  • 1
  • 1
Warren Kim
  • 306
  • 3
  • 4