Facebook Share Dialog fails - the operation couldn’t be completed swift
up vote
1
down vote
favorite
I am testing a on am iphone device, user is logged in facebook app.
In the do, catch
block I get error error is message: The operation couldn’t be completed. (FacebookShare.ShareError error 0.) on line 895 in /Users/bogdanbarbulescu/Desktop/myStreet.com/myStreet.com/MessagesViewController.swift.
I found another suggestion on github:
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
However, I get error Use of unresolved identifier 'FBSDKShareLinkContent'
. If click on on FBSDKShareLinkContent()
and jump to definition, I do get to FBSDKSharingContent.h
What am I doing wrong here?
import UIKit
import FacebookShare
import FacebookCore
import FacebookLogin
class MessagesVC
func invitePeopleTapped()
let alertController = UIAlertController(title: "Some title", message: "", preferredStyle: .actionSheet)
let shareOnFacebook = UIAlertAction(title: "Share on Facebook", style: .default) _ in
let linkContent = LinkShareContent(url: URL(string: "https://www.google.com")!, quote: "Discover & Talk ")
let shareDialog = ShareDialog(content: linkContent)
shareDialog.mode = .native
shareDialog.failsOnInvalidData = true
shareDialog.completion = result in
print("the result is (result)")
do
try shareDialog.show()
catch
printsNow(message: error.localizedDescription)
alertController.addAction(shareOnFacebook)
self.present(alertController, animated: true, completion: nil)
//end invitePeopleTapped
//end class
Using Bolts (1.9.0)
Using FBSDKCoreKit (4.38.0)
Using FBSDKLoginKit (4.38.0)
Using FBSDKMessengerShareKit (1.3.2)
Using FBSDKShareKit (4.38.0)
Using FacebookCore (0.5.0)
Using FacebookLogin (0.5.0)
Using FacebookShare (0.5.0)
Using Firebase (5.11.0)
Using GTMSessionFetcher (1.2.0)
Using GeoFire (3.0.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.4)
Using Protobuf (3.6.1)
Using leveldb-library (1.20)
Using nanopb (0.3.901)
Using pop (1.0.10)
Full trace trace
2018-11-11 09:38:12.238951+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType
com.apple.social.facebook 2018-11-11 09:38:12.257468+0000
myStreet.com[6129:1364819] [core] SLComposeViewController
isAvailableForServiceType got serviceType com.apple.social.facebook
isAvailable 0 2018-11-11 09:38:12.295729+0000
myStreet.com[6129:1365297] [core] SLComposeViewController
_shareExtensionWithIdentifier: continuous discovery block got extensions (
" id = com.apple.share.SinaWeibo.post",
" id = com.apple.share.TencentWeibo.post",
" id = com.apple.share.Facebook.post",
" id = com.apple.share.Vimeo.post",
" id = com.apple.Music.MediaSocialShareService",
" id = com.apple.mobileslideshow.StreamShareService",
" id = com.apple.Health.HealthShareExtension",
" id = com.apple.reminders.RemindersEditorExtension",
" id = com.apple.share.Flickr.post",
" id = com.apple.mobilenotes.SharingExtension",
" id = com.apple.share.Twitter.post",
" id = net.whatsapp.WhatsApp.ShareExtension" ) error (null) 2018-11-11
09:38:12.296845+0000 myStreet.com[6129:1365297] [core]
SLComposeViewController _shareExtensionWithIdentifier: continuous
discovery block did update _identifierToShareExtensionMap {
"com.apple.Health.HealthShareExtension" = " id = com.apple.Health.HealthShareExtension";
"com.apple.Music.MediaSocialShareService" = " id = com.apple.Music.MediaSocialShareService";
"com.apple.mobilenotes.SharingExtension" = " id = com.apple.mobilenotes.SharingExtension";
"com.apple.mobileslideshow.StreamShareService" = " id = com.apple.mobileslideshow.StreamShareService";
"com.apple.reminders.RemindersEditorExtension" = " id = com.apple.reminders.RemindersEditorExtension";
"com.apple.share.Facebook.post" = " id = com.apple.share.Facebook.post";
"com.apple.share.Flickr.post" = " id = com.apple.share.Flickr.post";
"com.apple.share.SinaWeibo.post" = " id = com.apple.share.Facebook.post for
extensionIdentifer com.apple.share.Facebook.post 2018-11-11
09:38:12.298926+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType returning YES for
overridden extensionIdentifier com.apple.share.Facebook.post
2018-11-11 09:38:12.298988+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType
com.apple.social.facebook returning 1 error is message: The operation
couldn’t be completed. (FacebookShare.ShareError error 0.) on line 895
in
/Users/bogdanbarbulescu/Desktop/myStreet.com/myStreet.com/MessagesViewController.swift.
swift facebook
add a comment |
up vote
1
down vote
favorite
I am testing a on am iphone device, user is logged in facebook app.
In the do, catch
block I get error error is message: The operation couldn’t be completed. (FacebookShare.ShareError error 0.) on line 895 in /Users/bogdanbarbulescu/Desktop/myStreet.com/myStreet.com/MessagesViewController.swift.
I found another suggestion on github:
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
However, I get error Use of unresolved identifier 'FBSDKShareLinkContent'
. If click on on FBSDKShareLinkContent()
and jump to definition, I do get to FBSDKSharingContent.h
What am I doing wrong here?
import UIKit
import FacebookShare
import FacebookCore
import FacebookLogin
class MessagesVC
func invitePeopleTapped()
let alertController = UIAlertController(title: "Some title", message: "", preferredStyle: .actionSheet)
let shareOnFacebook = UIAlertAction(title: "Share on Facebook", style: .default) _ in
let linkContent = LinkShareContent(url: URL(string: "https://www.google.com")!, quote: "Discover & Talk ")
let shareDialog = ShareDialog(content: linkContent)
shareDialog.mode = .native
shareDialog.failsOnInvalidData = true
shareDialog.completion = result in
print("the result is (result)")
do
try shareDialog.show()
catch
printsNow(message: error.localizedDescription)
alertController.addAction(shareOnFacebook)
self.present(alertController, animated: true, completion: nil)
//end invitePeopleTapped
//end class
Using Bolts (1.9.0)
Using FBSDKCoreKit (4.38.0)
Using FBSDKLoginKit (4.38.0)
Using FBSDKMessengerShareKit (1.3.2)
Using FBSDKShareKit (4.38.0)
Using FacebookCore (0.5.0)
Using FacebookLogin (0.5.0)
Using FacebookShare (0.5.0)
Using Firebase (5.11.0)
Using GTMSessionFetcher (1.2.0)
Using GeoFire (3.0.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.4)
Using Protobuf (3.6.1)
Using leveldb-library (1.20)
Using nanopb (0.3.901)
Using pop (1.0.10)
Full trace trace
2018-11-11 09:38:12.238951+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType
com.apple.social.facebook 2018-11-11 09:38:12.257468+0000
myStreet.com[6129:1364819] [core] SLComposeViewController
isAvailableForServiceType got serviceType com.apple.social.facebook
isAvailable 0 2018-11-11 09:38:12.295729+0000
myStreet.com[6129:1365297] [core] SLComposeViewController
_shareExtensionWithIdentifier: continuous discovery block got extensions (
" id = com.apple.share.SinaWeibo.post",
" id = com.apple.share.TencentWeibo.post",
" id = com.apple.share.Facebook.post",
" id = com.apple.share.Vimeo.post",
" id = com.apple.Music.MediaSocialShareService",
" id = com.apple.mobileslideshow.StreamShareService",
" id = com.apple.Health.HealthShareExtension",
" id = com.apple.reminders.RemindersEditorExtension",
" id = com.apple.share.Flickr.post",
" id = com.apple.mobilenotes.SharingExtension",
" id = com.apple.share.Twitter.post",
" id = net.whatsapp.WhatsApp.ShareExtension" ) error (null) 2018-11-11
09:38:12.296845+0000 myStreet.com[6129:1365297] [core]
SLComposeViewController _shareExtensionWithIdentifier: continuous
discovery block did update _identifierToShareExtensionMap {
"com.apple.Health.HealthShareExtension" = " id = com.apple.Health.HealthShareExtension";
"com.apple.Music.MediaSocialShareService" = " id = com.apple.Music.MediaSocialShareService";
"com.apple.mobilenotes.SharingExtension" = " id = com.apple.mobilenotes.SharingExtension";
"com.apple.mobileslideshow.StreamShareService" = " id = com.apple.mobileslideshow.StreamShareService";
"com.apple.reminders.RemindersEditorExtension" = " id = com.apple.reminders.RemindersEditorExtension";
"com.apple.share.Facebook.post" = " id = com.apple.share.Facebook.post";
"com.apple.share.Flickr.post" = " id = com.apple.share.Flickr.post";
"com.apple.share.SinaWeibo.post" = " id = com.apple.share.Facebook.post for
extensionIdentifer com.apple.share.Facebook.post 2018-11-11
09:38:12.298926+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType returning YES for
overridden extensionIdentifier com.apple.share.Facebook.post
2018-11-11 09:38:12.298988+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType
com.apple.social.facebook returning 1 error is message: The operation
couldn’t be completed. (FacebookShare.ShareError error 0.) on line 895
in
/Users/bogdanbarbulescu/Desktop/myStreet.com/myStreet.com/MessagesViewController.swift.
swift facebook
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am testing a on am iphone device, user is logged in facebook app.
In the do, catch
block I get error error is message: The operation couldn’t be completed. (FacebookShare.ShareError error 0.) on line 895 in /Users/bogdanbarbulescu/Desktop/myStreet.com/myStreet.com/MessagesViewController.swift.
I found another suggestion on github:
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
However, I get error Use of unresolved identifier 'FBSDKShareLinkContent'
. If click on on FBSDKShareLinkContent()
and jump to definition, I do get to FBSDKSharingContent.h
What am I doing wrong here?
import UIKit
import FacebookShare
import FacebookCore
import FacebookLogin
class MessagesVC
func invitePeopleTapped()
let alertController = UIAlertController(title: "Some title", message: "", preferredStyle: .actionSheet)
let shareOnFacebook = UIAlertAction(title: "Share on Facebook", style: .default) _ in
let linkContent = LinkShareContent(url: URL(string: "https://www.google.com")!, quote: "Discover & Talk ")
let shareDialog = ShareDialog(content: linkContent)
shareDialog.mode = .native
shareDialog.failsOnInvalidData = true
shareDialog.completion = result in
print("the result is (result)")
do
try shareDialog.show()
catch
printsNow(message: error.localizedDescription)
alertController.addAction(shareOnFacebook)
self.present(alertController, animated: true, completion: nil)
//end invitePeopleTapped
//end class
Using Bolts (1.9.0)
Using FBSDKCoreKit (4.38.0)
Using FBSDKLoginKit (4.38.0)
Using FBSDKMessengerShareKit (1.3.2)
Using FBSDKShareKit (4.38.0)
Using FacebookCore (0.5.0)
Using FacebookLogin (0.5.0)
Using FacebookShare (0.5.0)
Using Firebase (5.11.0)
Using GTMSessionFetcher (1.2.0)
Using GeoFire (3.0.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.4)
Using Protobuf (3.6.1)
Using leveldb-library (1.20)
Using nanopb (0.3.901)
Using pop (1.0.10)
Full trace trace
2018-11-11 09:38:12.238951+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType
com.apple.social.facebook 2018-11-11 09:38:12.257468+0000
myStreet.com[6129:1364819] [core] SLComposeViewController
isAvailableForServiceType got serviceType com.apple.social.facebook
isAvailable 0 2018-11-11 09:38:12.295729+0000
myStreet.com[6129:1365297] [core] SLComposeViewController
_shareExtensionWithIdentifier: continuous discovery block got extensions (
" id = com.apple.share.SinaWeibo.post",
" id = com.apple.share.TencentWeibo.post",
" id = com.apple.share.Facebook.post",
" id = com.apple.share.Vimeo.post",
" id = com.apple.Music.MediaSocialShareService",
" id = com.apple.mobileslideshow.StreamShareService",
" id = com.apple.Health.HealthShareExtension",
" id = com.apple.reminders.RemindersEditorExtension",
" id = com.apple.share.Flickr.post",
" id = com.apple.mobilenotes.SharingExtension",
" id = com.apple.share.Twitter.post",
" id = net.whatsapp.WhatsApp.ShareExtension" ) error (null) 2018-11-11
09:38:12.296845+0000 myStreet.com[6129:1365297] [core]
SLComposeViewController _shareExtensionWithIdentifier: continuous
discovery block did update _identifierToShareExtensionMap {
"com.apple.Health.HealthShareExtension" = " id = com.apple.Health.HealthShareExtension";
"com.apple.Music.MediaSocialShareService" = " id = com.apple.Music.MediaSocialShareService";
"com.apple.mobilenotes.SharingExtension" = " id = com.apple.mobilenotes.SharingExtension";
"com.apple.mobileslideshow.StreamShareService" = " id = com.apple.mobileslideshow.StreamShareService";
"com.apple.reminders.RemindersEditorExtension" = " id = com.apple.reminders.RemindersEditorExtension";
"com.apple.share.Facebook.post" = " id = com.apple.share.Facebook.post";
"com.apple.share.Flickr.post" = " id = com.apple.share.Flickr.post";
"com.apple.share.SinaWeibo.post" = " id = com.apple.share.Facebook.post for
extensionIdentifer com.apple.share.Facebook.post 2018-11-11
09:38:12.298926+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType returning YES for
overridden extensionIdentifier com.apple.share.Facebook.post
2018-11-11 09:38:12.298988+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType
com.apple.social.facebook returning 1 error is message: The operation
couldn’t be completed. (FacebookShare.ShareError error 0.) on line 895
in
/Users/bogdanbarbulescu/Desktop/myStreet.com/myStreet.com/MessagesViewController.swift.
swift facebook
I am testing a on am iphone device, user is logged in facebook app.
In the do, catch
block I get error error is message: The operation couldn’t be completed. (FacebookShare.ShareError error 0.) on line 895 in /Users/bogdanbarbulescu/Desktop/myStreet.com/myStreet.com/MessagesViewController.swift.
I found another suggestion on github:
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
However, I get error Use of unresolved identifier 'FBSDKShareLinkContent'
. If click on on FBSDKShareLinkContent()
and jump to definition, I do get to FBSDKSharingContent.h
What am I doing wrong here?
import UIKit
import FacebookShare
import FacebookCore
import FacebookLogin
class MessagesVC
func invitePeopleTapped()
let alertController = UIAlertController(title: "Some title", message: "", preferredStyle: .actionSheet)
let shareOnFacebook = UIAlertAction(title: "Share on Facebook", style: .default) _ in
let linkContent = LinkShareContent(url: URL(string: "https://www.google.com")!, quote: "Discover & Talk ")
let shareDialog = ShareDialog(content: linkContent)
shareDialog.mode = .native
shareDialog.failsOnInvalidData = true
shareDialog.completion = result in
print("the result is (result)")
do
try shareDialog.show()
catch
printsNow(message: error.localizedDescription)
alertController.addAction(shareOnFacebook)
self.present(alertController, animated: true, completion: nil)
//end invitePeopleTapped
//end class
Using Bolts (1.9.0)
Using FBSDKCoreKit (4.38.0)
Using FBSDKLoginKit (4.38.0)
Using FBSDKMessengerShareKit (1.3.2)
Using FBSDKShareKit (4.38.0)
Using FacebookCore (0.5.0)
Using FacebookLogin (0.5.0)
Using FacebookShare (0.5.0)
Using Firebase (5.11.0)
Using GTMSessionFetcher (1.2.0)
Using GeoFire (3.0.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.4)
Using Protobuf (3.6.1)
Using leveldb-library (1.20)
Using nanopb (0.3.901)
Using pop (1.0.10)
Full trace trace
2018-11-11 09:38:12.238951+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType
com.apple.social.facebook 2018-11-11 09:38:12.257468+0000
myStreet.com[6129:1364819] [core] SLComposeViewController
isAvailableForServiceType got serviceType com.apple.social.facebook
isAvailable 0 2018-11-11 09:38:12.295729+0000
myStreet.com[6129:1365297] [core] SLComposeViewController
_shareExtensionWithIdentifier: continuous discovery block got extensions (
" id = com.apple.share.SinaWeibo.post",
" id = com.apple.share.TencentWeibo.post",
" id = com.apple.share.Facebook.post",
" id = com.apple.share.Vimeo.post",
" id = com.apple.Music.MediaSocialShareService",
" id = com.apple.mobileslideshow.StreamShareService",
" id = com.apple.Health.HealthShareExtension",
" id = com.apple.reminders.RemindersEditorExtension",
" id = com.apple.share.Flickr.post",
" id = com.apple.mobilenotes.SharingExtension",
" id = com.apple.share.Twitter.post",
" id = net.whatsapp.WhatsApp.ShareExtension" ) error (null) 2018-11-11
09:38:12.296845+0000 myStreet.com[6129:1365297] [core]
SLComposeViewController _shareExtensionWithIdentifier: continuous
discovery block did update _identifierToShareExtensionMap {
"com.apple.Health.HealthShareExtension" = " id = com.apple.Health.HealthShareExtension";
"com.apple.Music.MediaSocialShareService" = " id = com.apple.Music.MediaSocialShareService";
"com.apple.mobilenotes.SharingExtension" = " id = com.apple.mobilenotes.SharingExtension";
"com.apple.mobileslideshow.StreamShareService" = " id = com.apple.mobileslideshow.StreamShareService";
"com.apple.reminders.RemindersEditorExtension" = " id = com.apple.reminders.RemindersEditorExtension";
"com.apple.share.Facebook.post" = " id = com.apple.share.Facebook.post";
"com.apple.share.Flickr.post" = " id = com.apple.share.Flickr.post";
"com.apple.share.SinaWeibo.post" = " id = com.apple.share.Facebook.post for
extensionIdentifer com.apple.share.Facebook.post 2018-11-11
09:38:12.298926+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType returning YES for
overridden extensionIdentifier com.apple.share.Facebook.post
2018-11-11 09:38:12.298988+0000 myStreet.com[6129:1364819] [core]
SLComposeViewController isAvailableForServiceType
com.apple.social.facebook returning 1 error is message: The operation
couldn’t be completed. (FacebookShare.ShareError error 0.) on line 895
in
/Users/bogdanbarbulescu/Desktop/myStreet.com/myStreet.com/MessagesViewController.swift.
swift facebook
swift facebook
edited Nov 11 at 10:01
asked Nov 11 at 9:51
bibscy
1,018828
1,018828
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
your'e missing the library
import FBSDKShareKit
for this code to work
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
your'e missing the library
import FBSDKShareKit
for this code to work
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
add a comment |
up vote
1
down vote
accepted
your'e missing the library
import FBSDKShareKit
for this code to work
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
your'e missing the library
import FBSDKShareKit
for this code to work
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
your'e missing the library
import FBSDKShareKit
for this code to work
let content = FBSDKShareLinkContent()
content.contentURL = URL(string: "https://developers.facebook.com")
FBSDKShareDialog.show(from: self, with: content, delegate: self)
answered Nov 11 at 18:24
Arie Pinto
678614
678614
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53247543%2ffacebook-share-dialog-fails-the-operation-couldn-t-be-completed-swift%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