【问题标题】:Network Error: expo-app-auth - Broken Request - React Native网络错误:expo-app-auth - 请求中断 - React Native
【发布时间】:2019-09-01 22:41:27
【问题描述】:

我正在尝试通过 Spotify api 为我的 React-Native 应用程序进行 oAuth,但继续收到 ExpoAppAuth.get Auth: Network Error 消息。我不明白问题可能是什么,或者特别是在哪里看,因为痕迹太模糊了。我的 clientID 等也是正确的。

    `import * as AppAuth from 'expo-app-auth;

    let userData = {
   clientId: 'CLIENT_ID',
   additionalParameters: {response_type: 'code', show_dialog: true},
   redirectUrl: 'http://www.google.com',
   issuer: "https://accouns.spotify.com/authorize"
 };

  AppAuth.authAsync(userData)
  .then( data => console.log(data))
  .catch( (error, state) => console.log(`Error: ${error} State: ${state}`));

【问题讨论】:

    标签: reactjs react-native oauth-2.0 expo spotify


    【解决方案1】:

    这与 https://github.com/expo/expo/pull/5311 中的问题有关 - expo-app-auth 中的三元运算符存在错误,该错误将被纳入即将发布的版本。同时,您必须在服务配置对象中为registrationEndpoint 指定一个虚拟值。

    【讨论】:

    • 这应该在最新的世博会版本中修复,如上所述。
    • 嗨!是的,就是这样。不知何故,我使用的是旧版本的插件。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2020-11-20
    • 2020-07-23
    • 2022-06-18
    • 2020-07-04
    • 2018-12-05
    • 2017-09-21
    • 2018-01-09
    • 1970-01-01
    相关资源
    最近更新 更多