So, in my app I can successfully share content. I have a question though.
Can I skip no.3? And let the user get the login details from FB app on his phone?
All I do for sharing is :
-(void) userTappedOnFBLink:(UIGestureRecognizer*)gestureRecognizer
{
NSLog(@"FB share");
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:SHARE_URL];
[FBSDKShareDialog showFromViewController:self.parentViewController
withContent:content
delegate:self];
}
If you want only share why don't use SLComposeViewController? Is native and don't use safari. Also works with twitter.
import Social
Create the SLComposeViewController:
if let vc = SLComposeViewController(forServiceType: SLServiceTypeFacebook) {
vc.setInitialText("Your post text") //Optional
vc.add(UIImage(named: "YourImageName")!) //Optional
vc.add(URL(string: "Your url")) //Optional
present(vc, animated: true)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With