[英]Problems with attach JSON on FBDialog using FBConnect on my iPhone App
I'm trying to publish a post on the wall using FBConnect on my iPhone App, but I'm having a very stranger issue with the attach JSON. 我正在尝试在iPhone App上使用FBConnect在墙上发布帖子,但是我对Attach JSON遇到了一个非常陌生的问题。
When I use the sample JSON that FBConnect includes it works great, the code is: 当我使用FBConnect包含的示例JSON很好用时,代码为:
dialog.attachment = @"{\"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\"}}}";
But, when I change the image source URL to another image hosted on my own server, it shows me correctly the FBDialog and the preview post, but when I tap the publish button, the Dialog dismiss as usual, but the post does not appear on the wall. 但是,当我将图像源URL更改为自己服务器上托管的另一个图像时,它正确地显示了FBDialog和预览帖子,但是当我点击“发布”按钮时,对话框照常关闭,但该帖子未显示在墙。
This is the attach JSON after the changes: 这是更改后的附加JSON:
dialog.attachment = @"{\"name\":\"Facebook Connect for iPhone\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://myownserver.com/myImage.png\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}";
Any idea of where is my mistake? 知道我的错误在哪里吗? Thanks. 谢谢。
After many attempts and no progress, I decide to try something unusual. 经过多次尝试但没有任何进展,我决定尝试一些不寻常的事情。 I changed the server where my picture was hosted... And it works! 我更改了托管图片的服务器...它可以正常工作! I do not know what caused it, but apparently the Facebook API produces some problems with some servers. 我不知道是什么原因造成的,但是很明显,Facebook API在某些服务器上会产生一些问题。
I hope this can be useful to someone. 我希望这对某人有用。 Greetings. 问候。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.