Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook share #134

Open
CrastaDaryl opened this issue Feb 11, 2015 · 2 comments
Open

Facebook share #134

CrastaDaryl opened this issue Feb 11, 2015 · 2 comments

Comments

@CrastaDaryl
Copy link

when FB apps present sharing gives the following message
share: { "error_message" : "Failed to generate preview for user."}
share result ret: 1

how to fix?

@CrastaDaryl
Copy link
Author

what should the preview_property and action_type be when sharing open graph objects,
should i also create action types and object under my app if it runs only on iOS and android ?

@kimnamcham
Copy link

I have created the open graph in my app. But i got the same problems, here is my code:

FacebookAgent::FBInfo params;
params.insert(std::make_pair("dialog", "shareOpenGraph"));
params.insert(std::make_pair("action_type", "hbirdgame:Test"));
params.insert(
std::make_pair("preview_property_name", "cocos_document"));
params.insert(std::make_pair("title", "Cocos2d-x Game Engine"));
params.insert(
std::make_pair("image",
"http://files.cocos2d-x.org/images/orgsite/logo.png"));
params.insert(
std::make_pair("url", "http://cocos2d-x.org/docs/catalog/en"));
params.insert(std::make_pair("description", "cocos document"));
params.insert(std::make_pair("object_type","hbirdgame:Project"));

    if (FacebookAgent::getInstance()->canPresentDialogWithParams(params)) {
        FacebookAgent::getInstance()->dialog(params,
                [=](int ret ,std::string& msg) {
                    callbackInfo->setString(msg.c_str());
                });
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants