user762914
user762914

Reputation: 1

Not able to publish using facebook api

i am retrieving access token using

 if (window.location.hash.length == 0) {
            url = "https://www.facebook.com/dialog/oauth?client_id=" +
                     appId + "&redirect_uri=" + window.location +
                     "&response_type=token&scope=email,read_stream,publish_stream";
                       window.location.href(url);

        } else {
            accessToken = window.location.hash.substring(1);
}

and publishing the feed using

 FacebookClient client = new FacebookClient(strAccessToken);
                Dictionary<string, object> postMessage = new Dictionary<string, object>();
                postMessage["message"] = "test post from facebook app";
                postMessage["link"] ="http://google.com";
                postMessage["name"] = "";
                postMessage["caption"] = "";
                postMessage["description"] = "test post from facebook app";

                object result = client.Post("me/feed", postMessage);

i am gettig the error 'unable to connect to remote server'

What could be the wrong here?

Upvotes: 0

Views: 308

Answers (1)

Fosco
Fosco

Reputation: 38506

You're storing the token in 'accessToken' but passing 'strAccessToken'? Could it be that simple?

Upvotes: 1

Related Questions