2015-01-14 73 views
0

当我尝试从iOS应用程序共享图片时,有时共享屏幕无法加载到Facebook应用程序上。这种情况发生在我长时间尝试分享照片后,第二次分享屏幕出现完美时。Facebook应用程序共享对话框有时不会出现

发生这种情况时,iOS应用程序会直接访问Facebook应用程序,但共享屏幕不会显示。它只是以新闻源而告终。

if ([FBDialogs canPresentShareDialogWithParams:params]) { 
     // Present share dialog 
     FBAppCall *call = [FBDialogs presentShareDialogWithLink:params.link 
              name:params.name 
             caption:params.caption 
            description:params.linkDescription 
             picture:params.picture 
            clientState:nil 
             handler:^(FBAppCall *call, NSDictionary *results, NSError *error) { 

}]; } 

有人知道是什么原因导致了这种突然的行为吗?

+0

这似乎是一个类似的问题,http://stackoverflow.com/问题/ 17684886 /有时这个Facebook的分享对话框没有加载在ios?rq = 1 –

+0

是的,这是解释它,但它并没有提供任何解决方案。 – FacebookAppUser

回答

0

嘿,如果你的设备dnt hv Facebook应用程序然后这个块不会执行..那么你应该处理你的代码块到其他部分。使用饲料场景.....检查第一

修改

FBLinkShareParams *params = [[FBLinkShareParams alloc] init]; 
params.link = YOUR_URL; 
params.picture=YOUR_PICTURE_URL; 
params.name=NAME; 
params.caption =YOUR_CAPTION_OR_DESCRIPTION; 
params.linkDescription = DESCRIPTION_LINK; 

// If the Facebook app is installed and we can present the share dialog 

if ([FBDialogs canPresentShareDialogWithParams:params]) 
{ 
    // Present share dialog 
    [FBDialogs presentShareDialogWithLink:params.link handler:^(FBAppCall *call, NSDictionary *results, NSError *error) 
     { 
      //Handle result and error.... 
     }]; 
} 
else 
{ 
    // FALLBACK: publish just a link using the Feed dialog 
} 

这将工作....

+0

Facebook应用程序安装在设备中,问题是有时共享屏幕不会第一次显示。它只是用新闻提要打开应用程序。第二次以后它完美地工作。 – FacebookAppUser

+0

嘿我修改了我的答案** @ FacebookAppUser **尝试.... –

相关问题