expo inject is use to inject native code
npm install expo-injectstrings.xml file in React Native Expo projects.
expo-inject via npm or yarn:
bash
npm install -D expo-inject
`
or
`bash
yarn add -D expo-inject
`
Usage
$3
Create a new file (app.plugin.js) in the root of your project where your app.json is located.
`js
// app.plugin.js
module.exports = require("expo-inject");
`
In your app.json file, add the file to the plugin array and pass the required props.
`json
// app.json
{
"expo": {
...otherProps,
"plugins": [
["./inject.js", {
"file": "string.xml",
"name": "string_name",
"value": "string_value",
"translatable": "",
"targetApi": ""
}]
]
}
}
`
$3
If the file to inject is not defined, expo-inject will return the default config.
API
`js
withExpoInjectStringsXml(config, props);
``