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, 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.
Go to your Facebook App --> Settings--> Paste Hash key in "key hashes" option -->save changes. Now Test your android app with Facebook Log-in/Share etc.
To use the Facebook SDK in an Android Studio project, add the SDK as a build dependency and import the SDK. Go to Android Studio | New Project | Minimum SDK. Select API 15: Android 4.0. 3 (IceCreamSandwich) or higher and create your new project.
The error message tells what the issue is: "URL blocked: This redirect failed because the redirect URI is not whitelisted in the app's client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs." This is easily fixed.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With