reactjs - Discord oAuth 与本机反应
问题描述
所以在过去的一天里,我一直试图将不和谐的 oAuth 实现到一个反应原生的应用程序中,但无济于事。我尝试使用 react-native-app-auth 包,但收到null is not an object (evaluating 'RNAppAuth.authorize')
代码错误
const config = {
clientId: '[REDACTED]',
clientSecret: '[REDACTED]',
redirectUrl: '[REDACTED]',
scopes: ['identify'],
serviceConfiguration: {
authorizationEndpoint: 'https://discord.com/api/oauth2/authorize?client_id=[REDACTED]&redirect_uri=[REDACTED]',
tokenEndpoint: 'https://discordapp.com/api/oauth2/token',
revocationEndpoint: 'https://discordapp.com/api/oauth2/token/revoke'
}
}
try {
const authResult = await authorize(config)
console.log(authResult)
} catch (error) {
console.log(error)
}
}
然后我尝试了expo身份验证方法,但那个方法根本不起作用,有人可以帮我吗?任何帮助将不胜感激。使用 expo 42.0.1、react 16.13.1 和 react native 42.0.0 运行 expo proj。
解决方案
推荐阅读
- java - 突出显示 ListCells 时浮动矩形
- git - Git 公共子存储库
- odoo - 如何在 Odoo 13 网站中显示消息框
- nuget - Nuget List 命令不包括来自 Artifactory Nuget 存储库的所有结果
- python - Series 的第 n 项的总和
- kendo-ui - 使用带有锚点的 Kendo 弹出窗口 Angular
- javascript - 如何使用 ajv 模式验证验证值是否为格式和/或类型为 double?
- c++ - 如何让我的代码适用于较大的 N 值?
- java - PCB 类型中的方法 placeComponent() 不适用于参数(HardwareComponent)
- asp.net-mvc - 传递 htmlAttributes 时在 MVC 中使用 @Ajax.ActionLink 时出现问题