Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 从iPhone应用程序发布到facebook墙的链接_Ios_Facebook_Facebook Graph Api_Facebook Ios Sdk - Fatal编程技术网

Ios 从iPhone应用程序发布到facebook墙的链接

Ios 从iPhone应用程序发布到facebook墙的链接,ios,facebook,facebook-graph-api,facebook-ios-sdk,Ios,Facebook,Facebook Graph Api,Facebook Ios Sdk,我通过一个iPhone应用程序发布到facebook的墙上。当我只是发送一条消息时,它工作得很好,但当我尝试添加一个链接时,该消息不会发布在Facebook上 代码: 当我在params字典中添加链接和标题时,FaceBook不会在墙上发布。我甚至没有在(void)request:(FBRequest*)request didFailWithError:(nError*)error中得到错误,所以Facebook似乎认为这个请求是可以的。我只是在FB中使用附件发布了链接 NSDictionary

我通过一个iPhone应用程序发布到facebook的墙上。当我只是发送一条消息时,它工作得很好,但当我尝试添加一个链接时,该消息不会发布在Facebook上

代码:


当我在params字典中添加链接和标题时,FaceBook不会在墙上发布。我甚至没有在
(void)request:(FBRequest*)request didFailWithError:(nError*)error中得到错误,所以Facebook似乎认为这个请求是可以的。

我只是在FB中使用附件发布了链接

NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                            @"Visit My Site", @"name",
                            @"http://www.mysite.com", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"Your Message",@"message",
                                   attachmentStr,@"attachment",nil];

我刚刚在FB中发布了带有附件的链接

NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                            @"Visit My Site", @"name",
                            @"http://www.mysite.com", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"Your Message",@"message",
                                   attachmentStr,@"attachment",nil];

你可能想退房。它是一个维护良好的开源库,用于与各种社交网络服务进行接口,并保持与ShareKit社区的API兼容性。

您可能想查看一下。它是一个维护良好的开源库,用于与各种社交网络服务进行接口,并保持与ShareKit社区的API兼容性。

要在FB上显示链接,您可以使用actionLinks

德尔盖茨

dialog.actionLinks = @"[{\"text\":\"See My App here!\",\"href\":\"http://www.facebook.com/developers/apps.php?app_id=178257532217623&ret=2/\"}]";

这将在帖子的右侧显示你的链接

要在FB上显示链接,你可以使用actionLinks

德尔盖茨

dialog.actionLinks = @"[{\"text\":\"See My App here!\",\"href\":\"http://www.facebook.com/developers/apps.php?app_id=178257532217623&ret=2/\"}]";

这将在帖子的右侧显示您的链接,我不确定您的问题是什么,因为看起来一切正常,但这可能有助于您排除故障:

尝试在该页面上通过表单发布您的消息,看看Facebook会告诉您什么。如果出现问题,您将看到一条错误消息

要发布链接,您需要使用以下语法添加附件:

{ "href": "http://www.fantasy-fan.org", "name": "test", "caption": "test2", "description": "test3", "media": [{ "type": "image", "src": "http://dragontest.fantasy-fan.org/images/dwarf.jpg", "href": "http://www.fantasy-fan.org" }]}

我不确定您的问题是什么,因为一切看起来都很好,但这可能有助于您排除故障:

尝试在该页面上通过表单发布您的消息,看看Facebook会告诉您什么。如果出现问题,您将看到一条错误消息

要发布链接,您需要使用以下语法添加附件:

{ "href": "http://www.fantasy-fan.org", "name": "test", "caption": "test2", "description": "test3", "media": [{ "type": "image", "src": "http://dragontest.fantasy-fan.org/images/dwarf.jpg", "href": "http://www.fantasy-fan.org" }]}

如果您使用的是
FBConnect
,那么使用这种方法,所有东西都会贴在FB墙上

- (void)postToWall 
 {

   FBStreamDialog *dialog = [[[FBStreamDialog alloc] init] autorelease];
   dialog.userMessagePrompt = @"Enter your message:";
   dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Facebook Connect for iPhone\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}"];
   [dialog show];

 }

如果您使用的是
FBConnect
,那么使用这种方法,所有东西都会贴在FB墙上

- (void)postToWall 
 {

   FBStreamDialog *dialog = [[[FBStreamDialog alloc] init] autorelease];
   dialog.userMessagePrompt = @"Enter your message:";
   dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Facebook Connect for iPhone\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}"];
   [dialog show];

 }

我也遇到了同样的问题,但是使用了一个PHP应用程序,通过获取页面访问令牌解决了这个问题。拥有用户访问令牌后,转到:


在返回的数据中找到页面的名称及其相应的访问令牌。使用页面访问令牌可以发布我的链接。

我也遇到了同样的问题,但使用了PHP应用程序,通过获取页面访问令牌解决了这个问题。拥有用户访问令牌后,转到:


在返回的数据中找到页面的名称及其相应的访问令牌。使用页面访问令牌可以发布我的链接。

使用这个。这个对我来说很好用

 NSString *graphPath = @"me/feed";

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                self.link,@"link",
                                                self.url,@"picture",
                                                 self.message,@"name",
                                                @"Write_Captioon",@"caption",
                                                self.description,@"description",
                                                /*@"Facebook Dialogs are so easy!",@"message",*/
                                                nil];

        [[FBRequestWrapper defaultManager] sendFBRequestWithGraphPath:graphPath params:params andDelegate:self];

也请检查您的url,可能是url的形式不正确。我在Facebook上没有遇到这种问题,但如果LinkedIn在我的url为“=”时,帖子未被共享,但已成功与其他url共享。希望这将对您有所帮助。

使用此功能。此功能对我来说很好

 NSString *graphPath = @"me/feed";

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                self.link,@"link",
                                                self.url,@"picture",
                                                 self.message,@"name",
                                                @"Write_Captioon",@"caption",
                                                self.description,@"description",
                                                /*@"Facebook Dialogs are so easy!",@"message",*/
                                                nil];

        [[FBRequestWrapper defaultManager] sendFBRequestWithGraphPath:graphPath params:params andDelegate:self];

也请检查您的url,可能是url的形式不正确。我在Facebook上没有遇到这种问题,但如果LinkedIn在我的url为“=”时,帖子没有被共享,而是成功地与其他url共享。希望这会对您有所帮助。

我已经看到这种方法使用了很多次,并且尝试了与我第一篇帖子相同的结果。另外,我在新Facebook API的文档中找不到任何关于“附件”的引用:我已经看到过很多使用该方法的情况,并且尝试过,结果与我第一篇文章中的结果相同。另外,我在新Facebook API的文档中找不到任何关于“附件”的引用:参数的字符限制是多少?参数的字符限制是多少?