英文:
Problem with Expo Authentication with Facebook and AuthSession API
问题
I had my Expo app with SDK 46 and I migrated to SDK 48. I have a Facebook login in my app and it was working perfectly with expo-facebook
package. With SDK 48 is required to use AuthSession API using expo-auth-session.
我之前的Expo应用使用SDK 46,现在已迁移到SDK 48。我的应用中有Facebook登录功能,之前使用expo-facebook
包完美运行。但在SDK 48中,需要使用expo-auth-session
来实现。
I followed all the instructions from here: https://docs.expo.dev/guides/facebook-authentication/ and I double-checked my Facebook app login settings:
我按照这里的所有指南进行操作:https://docs.expo.dev/guides/facebook-authentication/,并且仔细检查了我的Facebook应用程序登录设置:
In the Valid OAuth Redirect URIs field, the red numbers from the image are:
在“Valid OAuth Redirect URIs”字段中,图像中的红色数字是:
-
my expo whoami (login) and the second part
-
我的 Expo whoami (login) 以及第二部分
-
slug value inside my app.json
-
在我的 app.json 文件中的 slug 值
Then in my app, I set up everything as in the document and then I generated a development build:
然后,在我的应用中,我按照文档中的说明进行了设置,然后生成了一个开发版本构建:
eas build --profile development --platform ios
Then, once installed, I ran:
然后,一旦安装完成,我运行了:
expo start --dev-client
Just after the app main screen shows, I can see the following message:
在应用的主屏幕显示后,我看到以下消息:
You need to add this URL to your authorized redirect URLs on your Facebook app: fb{here is my fb app id}://authorize
您需要将此URL添加到您的Facebook应用程序的授权重定向URL中:fb{这里是我的fb应用程序ID}://authorize
What can I try next?
接下来我可以尝试什么?
英文:
I had my Expo app with SDK 46 and I migrated to SDK 48. I have a Facebook login in my app and it was working perfectly with expo-facebook
package. With SDK 48 is required to use AuthSession API using expo-auth-session.
I followed all the instructions from here: https://docs.expo.dev/guides/facebook-authentication/ and I double check my Facebook app login settings:
In the Valid OAuth Redirect URIs field the red numbers from image are:
-
my expo whoami (login) and the second part
-
slug value inside my app.json
Then in my app I setup everything as in the document and then I generate a development build:
eas build --profile development --platform ios
Then, once installed I ran:
expo start --dev-client
Just after the app main screen shows I can see the following message:
> You need to add this url to your authorized redirect urls on your Facebook app: fb{here is my fb app id}://authorize
What can I try next?
答案1
得分: 1
你尝试将app.json中的模式更新为一个包含您实际模式和Facebook模式的数组吗?
类似这样:
{ "expo": { "scheme": ["myAppSchema", "fbYOUR_FB_APP_ID"] } }
英文:
you try to update the schema inside of app.json to an array with you actual schema and the schema for Facebook ?
some like this
{"expo":"scheme":["myAppSchema","fbYOUR_FB_APP_ID"]}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论