gho*_*der 7 facebook facebook-graph-api ios
所以,在我的应用程序中,我可以成功分享内容.但我有个问题.
我可以跳过3号吗?让用户通过手机上的FB应用程序获取登录详细信息?
我所做的一切就是:
-(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];
}
Run Code Online (Sandbox Code Playgroud)
如果你只想分享为什么不使用 SLComposeViewController?是原生的,不使用 safari。也适用于推特。
import Social
Run Code Online (Sandbox Code Playgroud)
创建 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)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
472 次 |
| 最近记录: |