I am working on an app and I want to share an HTML link on Instagram and Slack. Is it possible to share a link on Instagram and slack?. Please give me some resource so that I can get my solution.
-
you can share link on slack check this [link](https://stackoverflow.com/questions/35931946/basic-example-for-sharing-text-or-image-with-uiactivityviewcontroller-in-swift), But on instagram you can not share link. only image sharing working in instagram. – Pratik Prajapati Jul 04 '18 at 09:40
-
and for slack use this -> https://github.com/SlackKit/SlackKit – dahiya_boy Jul 04 '18 at 09:41
-
#dahiya_boy the link you shared is written in objective C and I want the code in swift – Deevakar verma Jul 04 '18 at 09:46
-
@Deevakarverma After reading the pratik comment, I never shared any link so I am not sure about that whether you can share it or not. And for swift code better if you scroll down the [link](https://stackoverflow.com/questions/11393071/how-to-share-an-image-on-instagram-in-ios) – dahiya_boy Jul 04 '18 at 09:57
-
@dahiya_boy - i don't want to use slack it. please suggest me some another information. – Deevakar verma Jul 04 '18 at 09:58
-
@Deevakarverma check the slack official page for swift : https://api.slack.com/community – dahiya_boy Jul 04 '18 at 10:05
-
@dahiya_boy - is it possible without using slackkit . because I am using custom share popup. – Deevakar verma Jul 04 '18 at 10:09
-
1@Deevakarverma For custom popup, you have to use these libraries else you have to go with `UIActivitycontroller`. BTW w/o these libraries how you can connect your app with other apps. It's not possible buddy. – dahiya_boy Jul 04 '18 at 10:12
1 Answers
What you are looking for is UIActivityViewController
as documented here
Since you have no code examples, I will not provide any specifics because the documentation and a good search will help you with that. But in a higher level, you can use UIActivityViewController
to share data with other apps. It uses the native share action sheet that you should be familiar with. It also handle the apps to share data to based on the type of data you want to share (text, image, etc.). You have other options including but not limited to exclude certain apps even if they are available.
Once you try out the implementation and still are stuck, then I can help you further.
Instagram is tricky because I you need image data to be shared.
Looks like you can pass an image along to Instagram like this. I’m still not sure if this is what you want or not. You could hypothetically use UIDocumentInteractionController for Instagram exclusively from your native pop up which would mean the user is not offered an additional pop up to choose the target application, thus making it a seamless flow from your pop up to Instagram. Further research on the link I have provided my be necessary.

- 788
- 6
- 14
-
I am using custom share popup. I am not using UIActivityViewController. I want to share an image with the caption on Instagram. please tell me is this possible or not? – Deevakar verma Jul 04 '18 at 09:54