Swift: how to add App sharing feature with Extension Sheet
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I want to add the my app sharing feature in my App. Like The Action Sheet Toggle up with the all the social Media and other app in which i can share my app Url. I try to find the tutorial for that but i can't find the proper tutorial for that. this is what I have Done.
func shareApp (){
let textToShare = "Swift is awesome! Check out this website about it!"
if let myWebsite = NSURL(string: "http://www.google.com/") {
let objectsToShare = [textToShare, myWebsite] as [Any]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.excludedActivityTypes = [UIActivityType.airDrop, UIActivityType.addToReadingList]
self.present(activityVC, animated: true, completion: nil)
}
This What i Get.
So just want to show there Some Social Media options There.
ios swift xcode ios8-share-extension
add a comment |
I want to add the my app sharing feature in my App. Like The Action Sheet Toggle up with the all the social Media and other app in which i can share my app Url. I try to find the tutorial for that but i can't find the proper tutorial for that. this is what I have Done.
func shareApp (){
let textToShare = "Swift is awesome! Check out this website about it!"
if let myWebsite = NSURL(string: "http://www.google.com/") {
let objectsToShare = [textToShare, myWebsite] as [Any]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.excludedActivityTypes = [UIActivityType.airDrop, UIActivityType.addToReadingList]
self.present(activityVC, animated: true, completion: nil)
}
This What i Get.
So just want to show there Some Social Media options There.
ios swift xcode ios8-share-extension
1
You need to run the app on an actual device with a couple of installed apps. (e.g. WhatsApp, Telegram, Facebook)
– iVarun
Jan 3 at 5:17
so my code is perfect you mean that.
– Krunal Nagvadia
Jan 3 at 5:18
Yes, It looks good as you are also able to seeUIActivityViewController
. You just need to change URL to actual app URL that you want to share.
– iVarun
Jan 3 at 5:20
ok. i have to setup any permission for that in plist?
– Krunal Nagvadia
Jan 3 at 5:21
You don't need to set any permissions.
– iVarun
Jan 3 at 5:39
add a comment |
I want to add the my app sharing feature in my App. Like The Action Sheet Toggle up with the all the social Media and other app in which i can share my app Url. I try to find the tutorial for that but i can't find the proper tutorial for that. this is what I have Done.
func shareApp (){
let textToShare = "Swift is awesome! Check out this website about it!"
if let myWebsite = NSURL(string: "http://www.google.com/") {
let objectsToShare = [textToShare, myWebsite] as [Any]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.excludedActivityTypes = [UIActivityType.airDrop, UIActivityType.addToReadingList]
self.present(activityVC, animated: true, completion: nil)
}
This What i Get.
So just want to show there Some Social Media options There.
ios swift xcode ios8-share-extension
I want to add the my app sharing feature in my App. Like The Action Sheet Toggle up with the all the social Media and other app in which i can share my app Url. I try to find the tutorial for that but i can't find the proper tutorial for that. this is what I have Done.
func shareApp (){
let textToShare = "Swift is awesome! Check out this website about it!"
if let myWebsite = NSURL(string: "http://www.google.com/") {
let objectsToShare = [textToShare, myWebsite] as [Any]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.excludedActivityTypes = [UIActivityType.airDrop, UIActivityType.addToReadingList]
self.present(activityVC, animated: true, completion: nil)
}
This What i Get.
So just want to show there Some Social Media options There.
ios swift xcode ios8-share-extension
ios swift xcode ios8-share-extension
asked Jan 3 at 5:10


Krunal NagvadiaKrunal Nagvadia
15114
15114
1
You need to run the app on an actual device with a couple of installed apps. (e.g. WhatsApp, Telegram, Facebook)
– iVarun
Jan 3 at 5:17
so my code is perfect you mean that.
– Krunal Nagvadia
Jan 3 at 5:18
Yes, It looks good as you are also able to seeUIActivityViewController
. You just need to change URL to actual app URL that you want to share.
– iVarun
Jan 3 at 5:20
ok. i have to setup any permission for that in plist?
– Krunal Nagvadia
Jan 3 at 5:21
You don't need to set any permissions.
– iVarun
Jan 3 at 5:39
add a comment |
1
You need to run the app on an actual device with a couple of installed apps. (e.g. WhatsApp, Telegram, Facebook)
– iVarun
Jan 3 at 5:17
so my code is perfect you mean that.
– Krunal Nagvadia
Jan 3 at 5:18
Yes, It looks good as you are also able to seeUIActivityViewController
. You just need to change URL to actual app URL that you want to share.
– iVarun
Jan 3 at 5:20
ok. i have to setup any permission for that in plist?
– Krunal Nagvadia
Jan 3 at 5:21
You don't need to set any permissions.
– iVarun
Jan 3 at 5:39
1
1
You need to run the app on an actual device with a couple of installed apps. (e.g. WhatsApp, Telegram, Facebook)
– iVarun
Jan 3 at 5:17
You need to run the app on an actual device with a couple of installed apps. (e.g. WhatsApp, Telegram, Facebook)
– iVarun
Jan 3 at 5:17
so my code is perfect you mean that.
– Krunal Nagvadia
Jan 3 at 5:18
so my code is perfect you mean that.
– Krunal Nagvadia
Jan 3 at 5:18
Yes, It looks good as you are also able to see
UIActivityViewController
. You just need to change URL to actual app URL that you want to share.– iVarun
Jan 3 at 5:20
Yes, It looks good as you are also able to see
UIActivityViewController
. You just need to change URL to actual app URL that you want to share.– iVarun
Jan 3 at 5:20
ok. i have to setup any permission for that in plist?
– Krunal Nagvadia
Jan 3 at 5:21
ok. i have to setup any permission for that in plist?
– Krunal Nagvadia
Jan 3 at 5:21
You don't need to set any permissions.
– iVarun
Jan 3 at 5:39
You don't need to set any permissions.
– iVarun
Jan 3 at 5:39
add a comment |
2 Answers
2
active
oldest
votes
All you have done is right, except you have not added the App url of your appstore link. Add that link like https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8 and all your media will be appear in list if those application is installed in iphone.
ok so my code is perfect? Or need any implement? And i have to give any permission in info.plist or any other procedure to follow? Please explain in brief.
– Krunal Nagvadia
Jan 3 at 5:20
Check I have shared a code with you below in answer, This shares my App with link to all application which has sharing feature. like mail, facebook. but those application will appear in UIActivityViewController if those application installed in iPhone. in simulator you won't get application try it in real device which has facebook and mail application installed
– Paresh. P
Jan 3 at 5:40
add a comment |
You have got UIActivityViewController presented now, Just add in text like,
func ShareApp()
{
let items:[Any] = ["Marketplace of Building Material for Architects, Interior Designers, Contractors and Home Owners. Find Material for your next project. Download https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8"]
let ac = UIActivityViewController(activityItems: items, applicationActivities: nil)
self.present(ac, animated: true)
}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016663%2fswift-how-to-add-app-sharing-feature-with-extension-sheet%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
All you have done is right, except you have not added the App url of your appstore link. Add that link like https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8 and all your media will be appear in list if those application is installed in iphone.
ok so my code is perfect? Or need any implement? And i have to give any permission in info.plist or any other procedure to follow? Please explain in brief.
– Krunal Nagvadia
Jan 3 at 5:20
Check I have shared a code with you below in answer, This shares my App with link to all application which has sharing feature. like mail, facebook. but those application will appear in UIActivityViewController if those application installed in iPhone. in simulator you won't get application try it in real device which has facebook and mail application installed
– Paresh. P
Jan 3 at 5:40
add a comment |
All you have done is right, except you have not added the App url of your appstore link. Add that link like https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8 and all your media will be appear in list if those application is installed in iphone.
ok so my code is perfect? Or need any implement? And i have to give any permission in info.plist or any other procedure to follow? Please explain in brief.
– Krunal Nagvadia
Jan 3 at 5:20
Check I have shared a code with you below in answer, This shares my App with link to all application which has sharing feature. like mail, facebook. but those application will appear in UIActivityViewController if those application installed in iPhone. in simulator you won't get application try it in real device which has facebook and mail application installed
– Paresh. P
Jan 3 at 5:40
add a comment |
All you have done is right, except you have not added the App url of your appstore link. Add that link like https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8 and all your media will be appear in list if those application is installed in iphone.
All you have done is right, except you have not added the App url of your appstore link. Add that link like https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8 and all your media will be appear in list if those application is installed in iphone.
answered Jan 3 at 5:17
Paresh. PParesh. P
6118
6118
ok so my code is perfect? Or need any implement? And i have to give any permission in info.plist or any other procedure to follow? Please explain in brief.
– Krunal Nagvadia
Jan 3 at 5:20
Check I have shared a code with you below in answer, This shares my App with link to all application which has sharing feature. like mail, facebook. but those application will appear in UIActivityViewController if those application installed in iPhone. in simulator you won't get application try it in real device which has facebook and mail application installed
– Paresh. P
Jan 3 at 5:40
add a comment |
ok so my code is perfect? Or need any implement? And i have to give any permission in info.plist or any other procedure to follow? Please explain in brief.
– Krunal Nagvadia
Jan 3 at 5:20
Check I have shared a code with you below in answer, This shares my App with link to all application which has sharing feature. like mail, facebook. but those application will appear in UIActivityViewController if those application installed in iPhone. in simulator you won't get application try it in real device which has facebook and mail application installed
– Paresh. P
Jan 3 at 5:40
ok so my code is perfect? Or need any implement? And i have to give any permission in info.plist or any other procedure to follow? Please explain in brief.
– Krunal Nagvadia
Jan 3 at 5:20
ok so my code is perfect? Or need any implement? And i have to give any permission in info.plist or any other procedure to follow? Please explain in brief.
– Krunal Nagvadia
Jan 3 at 5:20
Check I have shared a code with you below in answer, This shares my App with link to all application which has sharing feature. like mail, facebook. but those application will appear in UIActivityViewController if those application installed in iPhone. in simulator you won't get application try it in real device which has facebook and mail application installed
– Paresh. P
Jan 3 at 5:40
Check I have shared a code with you below in answer, This shares my App with link to all application which has sharing feature. like mail, facebook. but those application will appear in UIActivityViewController if those application installed in iPhone. in simulator you won't get application try it in real device which has facebook and mail application installed
– Paresh. P
Jan 3 at 5:40
add a comment |
You have got UIActivityViewController presented now, Just add in text like,
func ShareApp()
{
let items:[Any] = ["Marketplace of Building Material for Architects, Interior Designers, Contractors and Home Owners. Find Material for your next project. Download https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8"]
let ac = UIActivityViewController(activityItems: items, applicationActivities: nil)
self.present(ac, animated: true)
}
add a comment |
You have got UIActivityViewController presented now, Just add in text like,
func ShareApp()
{
let items:[Any] = ["Marketplace of Building Material for Architects, Interior Designers, Contractors and Home Owners. Find Material for your next project. Download https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8"]
let ac = UIActivityViewController(activityItems: items, applicationActivities: nil)
self.present(ac, animated: true)
}
add a comment |
You have got UIActivityViewController presented now, Just add in text like,
func ShareApp()
{
let items:[Any] = ["Marketplace of Building Material for Architects, Interior Designers, Contractors and Home Owners. Find Material for your next project. Download https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8"]
let ac = UIActivityViewController(activityItems: items, applicationActivities: nil)
self.present(ac, animated: true)
}
You have got UIActivityViewController presented now, Just add in text like,
func ShareApp()
{
let items:[Any] = ["Marketplace of Building Material for Architects, Interior Designers, Contractors and Home Owners. Find Material for your next project. Download https://itunes.apple.com/in/app/more-customers-app/id1280868223?mt=8"]
let ac = UIActivityViewController(activityItems: items, applicationActivities: nil)
self.present(ac, animated: true)
}
answered Jan 3 at 5:37
Paresh. PParesh. P
6118
6118
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016663%2fswift-how-to-add-app-sharing-feature-with-extension-sheet%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You need to run the app on an actual device with a couple of installed apps. (e.g. WhatsApp, Telegram, Facebook)
– iVarun
Jan 3 at 5:17
so my code is perfect you mean that.
– Krunal Nagvadia
Jan 3 at 5:18
Yes, It looks good as you are also able to see
UIActivityViewController
. You just need to change URL to actual app URL that you want to share.– iVarun
Jan 3 at 5:20
ok. i have to setup any permission for that in plist?
– Krunal Nagvadia
Jan 3 at 5:21
You don't need to set any permissions.
– iVarun
Jan 3 at 5:39