FB sharing opens safari dialog box for login

So, in my app I can successfully share content. I have a question though.

  • User has not logged in FB from anywhere in the app
  • User has the FB app installed on his phone.
  • When I click share, I am being prompted to login using the FB in safari.
  • 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)
    }
    

    See my similar question - the new flow is result of updated FBSDK. If you downgrade FBSDK to 4.24.0, you should get an option for app login again.

    链接地址: http://www.djcxy.com/p/41062.html

    上一篇: 导航栏在自定义放松Segue期间是黑色的

    下一篇: FB共享打开Safari登录对话框