首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Facebook共享不起作用

Facebook共享不起作用
EN

Stack Overflow用户
提问于 2014-10-24 12:12:33
回答 1查看 818关注 0票数 3

我面临一个问题,在64位架构的iOS设备中,共享功能(Twitter和Facebook)不起作用。当我在32位架构的iOS设备上运行相同的代码时,它工作得很好。我已经更改了体系结构,也称为armv7 armv7s arm64。但我仍然面临着同样的问题。

这是我的代码:

代码语言:javascript
复制
/* Facebook sharing  */

SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
        [controller setInitialText:ARTICLE_GLOBAL_Title];
        [controller addImage:[UIImage imageNamed:@"144X144.png"]];
        [controller addURL:[NSURL URLWithString:ARTICLE_GLOBAL_Link]];
        [self presentViewController:controller animated:YES completion:nil];

这是输出:

插件com.apple.share.Facebook.post中断集线器连接错误Domain=NSCocoaErrorDomain Code=4097“操作无法完成。(可可错误4097。)(连接到名为com.apple.share.Facebook.post的服务) UserInfo=0x7f839249d090 {NSDebugDescription=connection到名为com.apple.share.Facebook.post的服务}

EN

回答 1

Stack Overflow用户

发布于 2015-08-12 07:16:59

看看它对你有帮助。

代码语言:javascript
复制
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

    SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result)
    {
        if (result == SLComposeViewControllerResultCancelled)
        {
            NSLog(@"User Cancelled");
            [callout dismiss];
        }
        else
        {
            NSLog(@"Item successfully posted on your wall.");
            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"Hello world." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [alert show];
            [callout dismiss];
        }

        [controller dismissViewControllerAnimated:YES completion:nil];
    };

    controller.completionHandler = myBlock;
    //Adding the Text to the facebook post value from iOS
    controller.title = lblTitle.text;
    [controller addImage:imagenews.image];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26547628

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档