开发者

Facebook Android sdk throwing missing redirect uri on Authetication

开发者 https://www.devze.com 2023-04-12 07:19 出处:网络
I\'m using the Facebook android sdk with my android app.Had everything going fine with my app while developing my dev version. When I finally when to publish my app to the public, the facebook autheni

I'm using the Facebook android sdk with my android app. Had everything going fine with my app while developing my dev version. When I finally when to publish my app to the public, the facebook authenication spits a ugly error when people try to authenticate my app:

API Error code: 100
API Error description: Invalid parameter
Error Message: Requires valid redirect URI

Seems like facebook thinks I'm doing a browser redirect to them and missing a redirect uri to return to my app, but I am using the android sdk in which you do not send a redirect uri, you have a callback listener:

facebook.authorize(this,开发者_C百科 new String[] { "email", "publish_stream" }, new FBLoginDialogListener());

Like i said this all worked fine during development and only showed up after released my prod version, so I have checked both the dev app setup and the prod app setup on fb, and they are both identical.

Anyone else see this issue?

UPDATE: It seems I only get this error when a user accepts allowing to log into my app, but then does not accept my permissions. hmmmmm. Maybe I'm not handling some situation, but the error still makes no sense to me.


I solved this issue by disabling the Enhanced Auth Dialog in the Advanced Settings of your app on https://developers.facebook.com/apps

Best regards


I have not work that much in Facebook but I thing you misunderstand about Redirect URL. In Facebook class there is a parameter REDIRECT_URI to redirect user if it success It will not redirect you to browser but it is called Facebook sdk provider

See this line

public static final String REDIRECT_URI = "fbconnect://success";

Check for this line in your application.I think there are some content provider in facebook API like fbconnect so that it will call internally that provider may be I am wrong.

Thanks.


I'm having such issue also: when i try to ask for new extended permission, facebook displays same error message for me. I think i got a workaround: try to ask in one request for new permission from "user and friend permissions" (i.e. "user_status") and with new permission from "extended permissions"(i.e. "read_stream") section. Permissions listed in http://developers.facebook.com/docs/reference/api/permissions/ Hope that it also will help for you.


I had the same problem. My app works perfectly yesterday and when I tried to run it today, it showed exactly the same message. What I tried is to reinstall the app and restart my phone, but neither worked. Then I uninstall the Facebook for Android (not the app I developed myself), and it worked just perfectly. Have no idea about the reason. Maybe try to uninstall the Facebook for Android on your phone and see whether it works?


Exactly the same problem here... been chasing it for hours...

Thanks to the tips above I have made a step forward.

I have written an app which updates the users status. With the new facebook layout this is the same as posting to the users wall.

It seems I need to have both permissions to do this: {"user_status", "publish_stream"}. I guess user_status gives me access to the status object, and publish_stream (which is an "extended" permission) gives me write access.

Some things to take care of when you are experimenting with permissions that I have found are as follows. If you change the permissions for your application then I advise doing the following: -Go to your facebook account with a web browser on your computer. Go the arrow next to Home at the top, choose account settings then select Apps on the left. Delete your app from here. -On your Android device (or emulator) Go to Settings -> Applications -> Manage. Then Uninstall your application. After that then from the same menu Force Quit the Facebook application.

After you have completed these steps you should have a clean sheet with regards to redeploying your application with different permissions. I this its the fact that the facebook app is caching something, and the permissions are already recorded in your facebook account that is causing this problem. There may be a neater solution you can implement in code though, so that if you change the permissions of your application between versions that it is properly picked up.

My app is now making status updates =)


I solved the problem by checking Embedded Browser OAuth Login" and entering the URL which my adobe air app uses for the browser embeded FB authentication

Facebook Android sdk throwing missing redirect uri on Authetication

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号