Created a react native and expo music player app which uses the Spotify web API, install the APK, and try to login but app will close 如何解决?

问题描述 投票:0回答:0

在尝试登录时安装 APK 后,应用程序将在物理设备和安卓模拟器中关闭

为了开发我使用 expo、react native 和 node.js 的应用程序,首先我在 react native 中请求授权代码,在将请求发送到 node.js 以获取访问令牌和刷新令牌之后,然后它重定向到应用程序主屏幕,我可以在其中看到播放列表列表, 这在模拟器中工作,但是当我在物理设备中构建和安装 APK 以及在模拟器中运行 APK 文件并尝试登录时关闭应用程序。 我用过 expo auth session

const [请求、响应、promptAsync] = useAuthRequest(
{

  clientId: Client_Id,
  scopes: [  "user-read-currently-playing",
  "user-read-recently-played",
  "user-read-playback-state",
  "user-top-read",
  "user-modify-playback-state",
  "streaming",
  "user-read-email",
  "user-read-private",],
 
  usePKCE: false,
  redirectUri:exp://192.168.1.15:19000/   (192.168.1.15) is get when I do the ipconfig
},
discovery

);

这样做之后,将授权代码发送到 node.js 以获得访问令牌 axios.post('http://192.168.1.15:3001/login',{
代码, })

安装应用程序 APK 时我必须对此做任何更改

node.js react-native expo spotify
© www.soinside.com 2019 - 2024. All rights reserved.