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

API Error on Example #3

Closed
wacheena opened this issue May 30, 2010 · 19 comments
Closed

API Error on Example #3

wacheena opened this issue May 30, 2010 · 19 comments

Comments

@wacheena
Copy link

I created a very test Facebook application and used the API key as the APP_ID in Example.java.

The example application runs perfectly for Login and the request button (it displays my Facebook name). When I click on the Wall Post! button I see the webview activity launch, then loads the following text:
API Error Code: 3
API Error Description: Unknown Method
Error Message: app must be on whitelist

I have tried three different application keys and always get the same result. Do I have an incorrect Facebook application setting, or is this an error that other people are getting?

@wacheena
Copy link
Author

BTW, I checked to make sure that I requested stream_publish when authorizing...

@NetApex
Copy link

NetApex commented May 30, 2010

I have done the same as wacheena with the same results. I thought I would check here first before I started digging to see if anyone else had the same issue. Apparently not enough people to come up with a solution. I guess I will have to see what I can find and I will report back here if I come up with something.

@soneff
Copy link

soneff commented May 31, 2010

Sorry, this looks like a server-side issue with a lot of apps, impacting the dialog() method with action "steam.publish" (the dialog used in the simple example to make a wall post). I'll ask someone for a fix. In the meantime, access to the rest of the API through the SDK should be unaffected, so you can ignore that part of the simple example app for now and you should be able to make a wall post directly using a POST request -- see the stream example.

Thanks for reporting, and thanks for you patience.

@langkins
Copy link

i met this problem too

@daen
Copy link

daen commented Jun 1, 2010

I have the same problem too.

@adagli
Copy link

adagli commented Jun 1, 2010

I did some basic changes and it works :)

add this function into AsyncFacebookRunner.java

public void requestPOST(String graphPath, Bundle parameters,RequestListener listener) { request(graphPath, parameters, "POST", listener); }

then add this line into Facebook.java

protected static String API_BASE_URL = "https://api.facebook.com/method/";

and change

public String request(String graphPath, Bundle parameters, String httpMethod) throws FileNotFoundException, MalformedURLException, IOException

like this

public String request(String graphPath, Bundle parameters, String httpMethod) throws FileNotFoundException, MalformedURLException, IOException {
parameters.putString("format", "json");
if (isSessionValid()) {
parameters.putString(TOKEN, getAccessToken());
}
String url;
if (httpMethod.equals("POST")) {
url = API_BASE_URL + graphPath;
} else {
url = graphPath != null ? GRAPH_BASE_URL + graphPath : RESTSERVER_URL;
}
return Util.openUrl(url, httpMethod, parameters);
}

and finally remove this line

params.putString("method", method);

from method

public static String openUrl(String url, String method, Bundle params) throws MalformedURLException, IOException

@krebchak
Copy link

krebchak commented Jun 1, 2010

Having same problem, where do you call the new function requestPOST?

thanks

@soneff
Copy link

soneff commented Jun 1, 2010

The issue with the Wall Post dialog (API Error Code: 3 ... ) should be fixed how -- let us know if you still have issues with this part of the Example application.

@krebchak
Copy link

krebchak commented Jun 1, 2010

did you just check in code, because i downloaded this today and am experiencing the same problem with the example?

@langkins
Copy link

langkins commented Jun 2, 2010

it works fine after do changes following what soneff said.

@adagli
Copy link

adagli commented Jun 2, 2010

Sorry krebchak.

I forgot it. you can call in Example.java like this:

mPostButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("message", "Lorem ipsum dolor");
// mFacebook.dialog(Example.this, "stream.publish", bundle,
// new SampleDialogListener());
mAsyncRunner.requestPOST("stream.publish", bundle, new WallPostRequestListener());
}
});

@Korriged
Copy link

Korriged commented Jun 2, 2010

Facebook API changed last week: requests "https://api.facebook.com?method=stream.publish&..." do not work
anymore and are replaced with "https://api.facebook.com/method/stream.publish?...".
-> I've submitted a bug about that on Facebook: http://bugs.developers.facebook.com/show_bug.cgi?id=8660

@Korriged
Copy link

Korriged commented Jun 2, 2010

I can see that this bug is closed. Does it mean that the code has been updated on GIT?
If yes, on which version?

@wacheena
Copy link
Author

wacheena commented Jun 2, 2010

@soneff, the update worked well for me. Thanks!
@Korriged, I think this was a server side change. But if it wasn't it's working for me with the latest version from GIT.

@wacheena
Copy link
Author

wacheena commented Jun 3, 2010

No, I didn't incorporate the changes. After the server side changes the example currently in git worked worked for me using an API key from a test app that I created last week. I haven't tried using an API key for my older applications yet.

@Korriged
Copy link

Korriged commented Jun 7, 2010

@ adagli: I have incorporated your correction and it works fine :).
Thank you for this patch :).

I hope your correction will be incorporated in the SDK soon.

@dbhasin
Copy link

dbhasin commented Jun 15, 2010

I want to use the links.preview and links.post publishing methods using the sdk. When will be able to do that? Also is there any other method instead of using the sdk that I could include those options in my android application.

@soneff
Copy link

soneff commented Jun 15, 2010

dbhasin, can you open this a separate issue? this thread is unrelated / closed...

kombucha pushed a commit to kombucha/facebook-android-sdk that referenced this issue Mar 16, 2013
Adds support to export the SDK as an apklib to a local maven repository....
This was referenced Aug 24, 2010
rotorgames pushed a commit to rotorgames/facebook-android-sdk that referenced this issue Aug 2, 2022
Updated Facebook APIs for iOS to version 4.11.0.0
@RichardValerosoUniverse
Copy link

This issue was closed.
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

10 participants