问题
I was following the tutorial for facebook sdk for ios, specially using open graph to attach an image and tag friends (which social framework can't do directly).
So I was following this tutorial and this sample app, FBOGSampleSD. https://developers.facebook.com/docs/ios/open-graph#sharedialog
However my post button in the share dialog is always disabled. (grey out)
Has anyone encountered this before?
I am working with Xcode 5 and testing on ios7 device.
Regards, Jin
回答1:
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.
回答2:
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!
回答3:
[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
来源:https://stackoverflow.com/questions/21155706/ios-facebook-sdk-v3-11-share-dialog-post-button-disabled