React native Google.logInAsync什么都不做

React native Google.logInAsync什么都不做,react-native,expo,google-login,React Native,Expo,Google Login,世博SDK版本:38.08 平台(Android/iOS/web/all):iOS和Android 我正在使用iOS上的expo客户端进行测试 我从GoogleAPI添加了OAuth2.0客户端ID Google.logInAsync函数不起任何作用 以下是我的代码片段: 注意:在实际实现中,我用实际的id替换了iOSCLIENTID和androidCLIENTID async function signInWithGoogleAsync() { try { const result = a

世博SDK版本:38.08 平台(Android/iOS/web/all):iOS和Android 我正在使用iOS上的expo客户端进行测试

我从GoogleAPI添加了OAuth2.0客户端ID

Google.logInAsync函数不起任何作用

以下是我的代码片段: 注意:在实际实现中,我用实际的id替换了iOSCLIENTID和androidCLIENTID

async function signInWithGoogleAsync() {
try {
  const result = await Google.logInAsync({
    androidClientId: androidCLIENTID,
    behavior: "web",
    iosClientId: iOSCLIENTID,
    scopes: ["profile", "email"],
  });
  if (result.type === "success") {
    return result.accessToken;
  } else {
    return { cancelled: true };
  }
} catch (e) {
  return { error: true };
}

}

很抱歉给你带来了困惑,这对我来说真是个愚蠢的错误。我没有将CLIENTID作为类型字符串传递