Question

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.

Was it helpful?

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

OTHER TIPS

The functionality that you're describing in Android is the ACTION_SEND Intent. You can read more about using this Intent to send text content to other apps in the Android Developer Training guide entitled Sending Simple Data to Other Apps.

As you seem to want this functionality for users to share the app with other users, iOS has the Social Framework for Social Sharing, or you could use a custom UIActionSheet to present the user with your own list of options.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top