简体   繁体   中英

Error with facebook login, react-native ios expo

I have a problem with my mobile app The problems is with the facebook login, but only in IOS It already works in android (even in production) Instead in IOS does not work in production, it only works in the XCODE emulator

My app.json looks like this:

{


"expo": {
   "name": "MyUniqueName",
   "facebookScheme":"fbMyFbAppId",
   "facebookAppId":"MyFbAppId",
   "facebookDisplayName":"MyUniqueName",
   "description": "This project is really great.",
   "slug": "MyUniqueName",
   "privacy": "public",
   "sdkVersion": "30.0.0",
   "platforms": ["ios", "android"],
   "version": "1.0.1",
   "orientation": "portrait",
   "icon": "./assets/favicon.png",
   "splash": {
     "image": "./assets/splash.png",
     "resizeMode": "cover",
   },
   "updates": {
     "fallbackToCacheTimeout": 0
   },
   "assetBundlePatterns": [
     "**/*"
   ],
   "ios": {
     "supportsTablet": true,
     "bundleIdentifier": "com.myCompany.myCompany",
     "infoPlist": {
       "LSApplicationQueriesSchemes": [
         "fbapi","fb-messenger-share-api","fbauth2","fbshareextension"
       ]
     }
   },
   "android": {
     "versionCode": 2,
     "package": "com.myCompany.myCompany"
   },
 }
}

My facebook console: console facebook

I printed the error but only I get this: app screenshot

I hope you are using Facebook.logInWithReadPermissionsAsync . If so,

Add behavior: 'web' as below.

It worked for me in Expo client and production as well.

Facebook.logInWithReadPermissionsAsync(Config.loginSetup.facebookID, 
 { 
 permissions: ['public_profile','email'],
 behavior: 'web'
 })

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM