繁体   English   中英

如何使用对话框将本地iOS应用程序的默认字符串设置为来自iPhone应用程序的Facebook页面

[英]How to set default String from native ios app to facebook page from iphone app using dialog

下面是我的代码

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"MyTestAPP", @"name",
                               @"http://myserver.com/", @"link",
                               @"My Post!", @"caption",
                               @"ValuedCommunity", @"description",
                               myMessage, @"message",              
                               nil];


// Publish.

[facebook dialog:@"feed" andParams:params andDelegate:self];

现在使用此代码,当我单击“发布”按钮时,我得到了 在此处输入图片说明

我已经尝试使用下面的代码对图api进行尝试,但是它给了我一个错误消息味精“ facebookerrdomain error 10000 ”。 [facebook requestWithGraphPath:@“ me / feed” andParams:params andHttpMethod:@“ POST” andDelegate:self]; 现在,我要做的是,要设置“ myMessage”文本,而不是对此说点什么。 有可能这样做吗? 如果是,那我该如何实现呢? 请咨询谢谢

一切皆有可能。 使用requestWithGraphPath:andParams:andHttpMethod:andDelegate:方法并将权限设置为publish_stream ,您将获得消息。

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   yourMessage,@"message",nil];

    NSString *user_selected = [NSString stringWithFormat:@"me/feed"];    
    [facebook requestWithGraphPath:user_selected andParams:params andHttpMethod:@"POST" andDelegate:self];

大家好,我很想解决过去2天的问题,以及如何解决,在NSMutableDictionary的param对象中再添加一个名为access_token的参数,如下所示

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Ahha", @"name",
                               @"http://vctestserver.com/", @"link",
                               @"VCAHHA", @"caption",
                               @"ValuedCommunity", @"description",
                               storyTwtFB, @"message", 
                               accessToken,@"access_token",
                               nil];
[facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

我从代表mathod [facebook accessToken]获得accessToken的值的位置。 storyTwtb是我想在Facebook上发布的应用程序的String。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM