您的配置无效。
这与https://github.com/expo/expo/pull/5311中的问题有关- expo-app-auth 中的三元运算符中存在错误,该错误将滚入即将发布的版本中。同时,您必须在服务配置对象中为registrationEndpoint 指定一个虚拟值。
const config = {
issuer: 'https://api.netatmo.com/oauth2/token',
clientId: 'cilentid',
clientSecret: 'cilentsecret',
scopes: ['read_presence'],
serviceConfiguration: {
registrationEndpoint: 'https://example.com'
}
}
如果不使用,您可以尝试其他方法。
您尝试并按照此链接上的型号npm install react-native-app-auth --save按照安装说明进行操作。
在此之前,您必须退出世博会。跑expo eject
例子
import { authorize } from 'react-native-app-auth';
const config = {
issuer: 'https://api.netatmo.com/oauth2/token',
clientId: 'cilentid',
redirectUrl: 'https://api.netatmo.com/',
scopes: ['read_presence'],
clientSecret: 'cilentsecret'
};
const result = await authorize(config);