0.1.7 • Published 2 months ago
rn-drivercom-framework v0.1.7
rn-drivercom-framework
this is a framework for applications drivercom
Installation
npm install rn-drivercom-framework
yarn add rn-drivercom-framework
Usage
import { getToken, DrivercomProviderProps } from 'rn-drivercom-framework';
// ...
const [result, setResult] = React.useState<
DrivercomProviderProps | undefined
>();
useEffect(() => {
const setToken = async () => {
try {
const res = await getToken();
console.log('result', res);
setResult(res);
} catch (error) {
console.error('Ocurrió un error al obtener el token:', error);
}
};
setToken();
}, [])
Information data
!NOTE The token returns three values the token, if the token is valid and if we have didcom provider
{
"userId": "0001",
"userName": "youruser@didcom.com.mx",
"database": "didcomdemo",
"token": "z[hmGz'hzwbu&/",
"drivercomProvider": true
}
!WARNING if no exits Drivercom on your device the response will be the following
{
"drivercomProvider": false
}
License
MIT
Made with create-react-native-library