Alvaro Bataller
Alvaro Bataller

Reputation: 483

React Native expo-facebook: Error ‘Given URL is not allowed by the Application Configuration.’

I’m trying to get Facebook Login working using the expo-facebook package (I'm using the Managed Workflow)

I created my application in the Facebook Developer Console and copied the “App ID”.

This is the code I'm using inside my React Native Expo app:

async facebookLogin() { 
    await Facebook.initializeAsync('26327628297297')
    const response = await Facebook.logInWithReadPermissionsAsync({ permissions: ['public_profile']})
    console.log(response)
}

My understanding is that while using the Expo Client App there is no need to do any extra configuration because it will be using Expo’s Facebook App ID for all API calls.

The problem is that after logging in I get this error message:

Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App’s settings. To use this URL you must add a valid native platform in your App’s settings.

I also tried added “facebookScheme” to my app.json but that didnt seem to help:

"facebookScheme": "fb26327628297297",

Thanks for your time!

Upvotes: 2

Views: 2282

Answers (1)

Muhammad Numan
Muhammad Numan

Reputation: 25363

Actually you just have to add platform in your app settings

So here are the steps

  1. Open https://developers.facebook.com and select your app

  2. Settings > Basic > Add Platform

  3. use host.expo.Exponent as bundle id

3.Now select iOS from the window and add your Bundle ID and rest of the information and click on Save changes enter image description here

and that's it. Hope it helps you .. All the best

Upvotes: 2

Related Questions