ios facebook sdk v3.11 share dialog post button disabled

妖精的绣舞 提交于 2019-12-02 01:52:48

I think I figure this out.

Your share button might be disabled because you didn't finish the Facebook app configuration, or it doesn't match what you are sharing through xcode/ios app.

- on Facebook Developer

In the settings of your app, you need to have iOS AND website added as platforms.

in the website platform you need to declare the website url or mobile site url: this is going to be used when someone click on your post from a computer. It needs to be a real site you can access, possibly the website of your app or a webpage about your app included on a website. For this example I'll be using

http://www.yourappwebsite.com

Once you do this, in the "Add Domains" field (in the section where you set namespace Display name and such), you need to put the SAME domain you declare as a website. This will be the only domain(s) allowed to host links and image of your OGStory. In this example is

yourappwebsite.com

- Back to Xcode

You should have some code that define the object you are posting an the action, something like:

[FBGraphObject openGraphObjectForPostWithType:@"yourapp:yourobject"
                                            title:@"Roasted pumpkin seeds"
                                            image:@"http://www.yourappwebsite.com/yourpic.png"
                                              url:@"http://www.yourappwebsite.com"
                                      description:@"Crunchy pumpkin seeds roasted in butter and lightly salted."];

As you can notice, the domain used for both the link AND the image is the one previously specified.

Now your share button should appear enabled.

I hope it helps, ciao.

David Jirman

I was struggling with the disabled POST button myself and it turned out that my App's plist information was not set correctly for Facebook integration. Specially the FacebookDisplayName must match the name you entered in your Fcb App settings.

This SO answer pointed me to right direction, hope it helps!

Yllow
[FBGraphObject openGraphObjectForPostWithType:@"namespace:yourobject"
                                        title:@"Roasted pumpkin seeds"
                                        image:@"http://www.yourappwebsite.com/yourpic.png"
                                          url:@"http://www.yourappwebsite.com"
                                  description:@"Crunchy pumpkin seeds roasted in butter and lightly salted."]

namespace is the one you have to set it in your setting->basic->namespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!