
[英]Why do I get UNKNOWN/CUSTOM URL SCHEME error in React Native Expo Google/Facebook login?
[英]Why am I getting error when using expo-facebook login in React Native?
我有一个托管工作流 expo 项目(SDK 44),我尝试按照文档来实施解决方案。 这些是我采取的步骤:
async function logIn() {
try {
await Facebook.initializeAsync({
appId: '<APP_ID>',
});
const { type, token, expirationDate, permissions, declinedPermissions } =
await Facebook.logInWithReadPermissionsAsync({
permissions: ['public_profile'],
});
if (type === 'success') {
// Get the user's name using Facebook's Graph API
const response = await fetch(`https://graph.facebook.com/me?access_token=${token}`);
Alert.alert('Logged in!', `Hi ${(await response.json()).name}!`);
} else {
// type === 'cancel'
}
} catch ({ message }) {
alert(`Facebook Login Error: ${message}`);
}
}
然后它将我重定向到我的应用程序的 Facebook 页面,在那里我可以看到我的应用程序详细信息和图像。
添加 Facebook 凭据后,我收到以下错误:
Webpage not available The webpage at fbconnect://cct.host.exp.exponent#granted_scopes=public_profile&denied_scopes=&signed_request=VhUPKkgri83xZuKbpsop5XFf4sLD72HeFHn5mgHKtTY.&graph_domain=facebook&access_token=EAAPYJXwv3ysBAN0gNls0mMoJ9NoZBbRvOQYMyaAqwlfHL7vcZA1ZAq4jPJsZBZCZCc5qG6sWSBY5w7Xc4ZArScfi6bvIA7brKz4S4AtWUDLyw71hfmnHYckdi1fLSqRLZBxfVfEGDPz9W5ZBFxHsScpoFXI4EzTwis11hiD58yLXubhnn5JZBm08Fje7FhI0DbTBZA0AZAFgObcLC0s75ZCTQ7SaZAPKLRT3W0kAiAAi2eolUntXy6gslYKEYY&data_access_expiration_time=1651743691&expires_in=5182128&state=%7B%220_auth_logger_id%22%3A%228315c2f8-8e7f-42c5 -8496-5d45fd1f1f25%22%2C%223_method%22%3A%22custom_tab%22%2C%227_challenge%22%3A%22b4as3835lr367tdn0m0n%22%7D 无法加载,因为:
净::ERR_UNKNOWN_URL_SCHEME
我究竟做错了什么? :/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.