[英]Integrate Uber api in react-native
I want to integrate Uber API in the react-native app. 我想将Uber API集成到react-native应用程序中。 but they have not provide any SDK for react-native.
但是他们没有提供任何本机的SDK。 I have used curl for ajax calls.
我已经使用curl来进行ajax调用。 GET
/products
are working fine. GET
/products
运行正常。 But there is getting some problem at GET https://login.uber.com/oauth/v2/authorize
但是在GET
https://login.uber.com/oauth/v2/authorize
出现了一些问题
My sample code: 我的示例代码:
return response = fetch('https://login.uber.com/oauth/v2/authorize?response_type=code&client_id=egkTW9gypag3ja3Qp0EyEWBhi4xN-DsN&scope=all_trips+delivery+history+history_lite+places+profile+request+request_receipt+ride_widgets&redirect_uri=https://127.0.0.1:9000/login', {
method: 'GET',
headers: {},
}).then((response) => response.json())
.then((responseJson) => {
alert(responseJson);
this.setState({
uberData: responseJson.products
});
})
.catch((error) => {
return Promise.reject(error.message || error);
alert(error);
});
Please help me. 请帮我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.