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

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!

Actually you just have to add platform in your app settings
So here are the steps
Open https://developers.facebook.com and select your app
Settings > Basic > Add Platform
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
and that's it.
Hope it helps you .. All the best

Related

React Native - React-native-app-auth - service_configuration_fetch_error

Environment
Your Identity Provider: Azure
Platform that you're experiencing the issue on: Android
Are you using Expo?: No
React Native Version: 0.66.4
React Native App Auth Version: 6.4.0
Hi Folks,
My app is being used by about 300 users and we are getting a lot of complaints about problems logging into Microsoft using MFA.
After receiving the SMS and adding the code, the user confirms on the consent screen to be redirected back to the app but often he goes back to the Microsoft Login page.
The problem can be solved palliatively by clearing the cache of the Chrome app.
I put some logs on my AppCenter:
Below is what my code looks like:
And my Azure Url Redirect configuration on App Register:
Question:
I need to put on property appAuthRedirectScheme the same name of my bundleId? Or can I put any custom string?
And
What could be the problem on service_configuration_fetch_error?

Expo AuthSession new window not redirecting on Web

We are using AuthSession.startAsync to initiate an authentication process in our app, which is working fine on iOS and Android. However when we run it the web browser, instead of redirecting to the correct Auth0 sign in page, our sign in process is just opening another window of the app.
Code that’s causing the problem:
const result = await AuthSession.startAsync({
authUrl,
returnUrl: Platform.OS === 'web' ? getRedirectUri() : undefined,
});
Right now the authUrl is the correct url we need going to auth0, however it doesn’t open this url the way it does on mobile for signing in. Has anyone ran into this AuthSession issue before on an Expo web app?
Thanks in advance!
You need to call WebBrowser.maybeCompleteAuthSession();.
There is a warning in the AuthSession Expo Docs about this case:
🚨 In order to close the popup window on web, you
need to invoke WebBrowser.maybeCompleteAuthSession().
See the Identity example for more info.
The example they are talking about can be found here:
https://docs.expo.dev/guides/authentication/#identityserver-4
Just add WebBrowser.maybeCompleteAuthSession(); under imports in your login component file. Opened window will resolve correctly in Web.
It is not needed in android or ios app.

React Native Expo AuthSession; Google Authentication

I’m trying to setup the Google authentication using AuthSession in Expo documentation (without Firebase)
https://docs.expo.dev/guides/authentication/#google
The first problem is, that the slack example doesn’t work: on the devices and simulators nothing happen after pushing the button, and in web mode it returns an error
Error 401: invalid_client
The OAuth client was not found.
What I’ve done using steps in documentation:
I’m not sure if it’s necessary, but I’ve installed yarn add expo-application
I’ve registered in Credentials page (Google Cloud Platform)
Logged in using expo login, in the terminal where I was starting expo start
Created a new Google Client ID that will be used with expoClientId
(Image) New Google Client ID setting image
( I'm not allowed to input images now )
(Don’t know if it’s necessary) I’ve created a project in https://expo.dev/ and then published the project using dashboard of expo start
(Image) Setting for "publish" in expo start dashboard
Where:
“expo”: {
“name”: “rn-my-project”,
“slug”: “rn-my-project”,
“version”: “1.0.0”,
“orientation”: “portrait”,
…
}
Using the code in the example, provided in documentation for Google, I receive null as response.
As I understand, this should be enough to test the Google Authentication using AuthSession in Expo Go app. I also made iosClientId, androidClientId and webClientId, but I’m not sure if I made everything correct.
Will be glad for any help, because I couldn’t find any person with the problem as mine.
Yours sincerely.
P.S. I've successfully set up logInAsync for Google using this documentation, but it's written, that it is deprecated.

Auth0 unauthorized_client: Callback URL mismatch error in new React Native app

I've created a new React Native app that will use the same Auth0 database as my web app.
I created the app in Auth0 portal and created all the necessary settings following this article: https://auth0.com/docs/quickstart/native/react-native/00-login
Even though the callback URL is listed in Auth0 portal, after a log in attempt, I'm getting the following error:
error = unauthorized_client: Callback URL mismatch.
com.ingridtime://ingrid.auth0.com/android/com.ingridtime/callback
is not in the list
Here's the actual callback list from the Auth0 portal:
I'm using the latest versions of both React Native and Auth0 packages. Here's a screen shot of my package.json dependencies section:
Any idea what the issue here is?
Figured it out. The issue was with the custom login screen we had created which had another app's ID hard-coded in it.

Expo Notification askAsync() - Is there a way to customize the message?

I am using EXPO on a react native project and want to ask the user for push notification permission.
When I use the const {status} = await Permissions.askAsync(Permissions.NOTIFICATIONS); the message that appears is
"Expo" would like to send you notifications. Notifications may include sounds, badges, alerts and icon badges. These can be configured in settings.
My end user doesn't know what "Expo" is, they just know the app name. Is there a way for me to customize the "Expo" part to the app name?
How have people handled this when their app is ejected and push to the app store?
You can find the answer in here: https://docs.expo.io/distribution/app-stores/?redirected
Which says:
System permissions dialogs on iOS
If your app asks for system permissions from the user, e.g. to use the device's camera, or access photos, Apple requires an explanation for how your app makes use of that data. Expo will automatically provide a boilerplate reason for you, such as "Allow cool-app to access the camera", however these must be customized and tailored to your specific use case in order for your app to be accepted by the App Store. To do this, override these values using the ios.infoPlist key in app.json, for example:
"infoPlist": {
"NSCameraUsageDescription": "This app uses the camera to scan barcodes on event tickets."
},
The full list of keys Expo provides by default can be seen here. Unlike with Android, on iOS it is not possible to filter the list of permissions an app may request at a native level. This means that by default, your app will ship with all of these default boilerplate strings embedded in the binary. You can provide any overrides you want in the infoPlist configuration. Because these strings are configured at the native level, they will only be published when you build a new binary with expo build.
You probably use Expo Go to develop your app , when you create standalone app (when you deploy the apk) it will show the app name that you specified in app.json.