Expo身份验证与Facebook和AuthSession API的问题

huangapple go评论60阅读模式
英文:

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”字段中,图像中的红色数字是:

  1. my expo whoami (login) and the second part

  2. 我的 Expo whoami (login) 以及第二部分

  3. slug value inside my app.json

  4. 在我的 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

Expo身份验证与Facebook和AuthSession API的问题

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:

Expo身份验证与Facebook和AuthSession API的问题

In the Valid OAuth Redirect URIs field the red numbers from image are:

  1. my expo whoami (login) and the second part

  2. 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

Expo身份验证与Facebook和AuthSession API的问题

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"]} 

huangapple
  • 本文由 发表于 2023年5月18日 12:13:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76277689.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定