Simple Request Crash / Method manager
Use the yarn manager yarn to install react-native-ot-shield.
yarn add react-native-ot-shield
You must create one configuration file
{
"remote":"https://myremote.dev",
"actions": [
"isExampleToSimpleAction"
{
"name":"isExampleToComplexeAction",
"actions": [
"subAction",
"anotherSubAction"
]
}
]
}
shield.setup.json
import Shield from 'react-native-ot-shield'
Shield.load(require('myconfig.json'))
Simple action :
let result = await Shield.isExampleToSimpleAction({nameP:dataP}) // Return JSON
// This action send object {nameP:dataP, action: isExampleToSimpleAction} in post to request https://myremote.dev/isExampleToSimpleAction
Complexe action :
let result = await Shield.isExampleToComplexeAction.subAction({nameP:dataP}) // Return JSON
// This action send object {nameP:dataP, action: subAction} in post to request https://myremote.dev/isExampleToComplexeAction