Search code examples
androidiosurl-schemeopen-with

How to get apps can do the same things?


Sorry for my poor English. I have a problem & search for this several days :(. I have to port an app in Android to iOS. It has a function about sharing to other user : users can send a text message to their to present current app, like : "Good app, visit ... to download".

In Android, this function allow user choose one app from all apps in device can send text message (Message, Viber, Skype, ....). It shows a popup with list of apps.

It's like this image :

https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRnbaXCYqJmHJNY5n_2t4WDYU5GAIov_mntasEyAIRDJcAQQ7J1

It seem to be default behavior in Android, these lines of code is very simple. But in my iOS, i can't find the same way to make it ? I need your help ? How can i get these app in my app, i have read about "url scheme" - it can help me go to other app from my app. But most important is i don't know what apps can't send text message in device.


Solution

  • A quite similar option on iOS that compared to intent is to use

    UIDocumentInteractionController

    See the documentation here:

    https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/Reference/Reference.html#//apple_ref/doc/uid/TP40009304

    For social sharing only (Facebook + Twitter) you can use the SocialFramework on iOS6 or above: https://developer.apple.com/library/ios/documentation/Social/Reference/Social_Framework/_index.html