Can i use react-native-oauth for Magento API ?
Sorry, my english is bad. i got 4 values from Magento. OAuth 1.0. They are: "CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "TOKEN_SECRET" When i create my own provider, i got error Callback_url. Anyone know how can access Magento by react-native-oauth ?
import OAuthManager from 'react-native-oauth'; const parameter = require('./parameter.json');
async function authorization(){ try{ const manager = new OAuthManager('firestackexample') manager.addProvider({ 'magento': { auth_version: '1.0', } }); manager.configure({ magento: { auth_version: '1.0', oauth_consumer_key: parameter.CONSUMER_KEY, consumer_secret: parameter.CONSUMER_SECRET, oauth_token: parameter.ACCESS_TOKEN, oauth_signature_method: "HMAC-SHA1", } }); var urlWeb = parameter.api_url + '/V1/products?searchCriteria[sortOrders][0][field]=entity_id&searchCriteria[sortOrders][0][direction]=asc&searchCriteria[currentPage]=1&searchCriteria[pageSize]=10' manager.makeRequest('magento', urlWeb,{method: 'get'}).then(resp => { return resp.data; }); } catch(error) { console.error(error); } } export {authorization};