[英]Integrate Uber api in react-native
我想將Uber API集成到react-native應用程序中。 但是他們沒有提供任何本機的SDK。 我已經使用curl來進行ajax調用。 GET /products
運行正常。 但是在GET https://login.uber.com/oauth/v2/authorize
出現了一些問題
我的示例代碼:
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);
});
請幫我。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.