this is react native version of native metric Africa
npm install react-native-metric-africa
import {
initVerificationAndroid,
startMetricLauncherIOS,
initMetricSdkAndroid,
initializeIOS,
} from 'react-native-metric-africa';
// ...
export default function App() {
const [result, setResult] = useState<string | undefined>();
useEffect(() => {
if (Platform.OS === 'android') {
initMetricSdkAndroid('', '', '', '', '', false).then((res) =>
setResult(res)
);
} else {
initializeIOS('', '').then((res) => setResult(res));
}
}, []);
return (
<View style={styles.container}>
<Text>Result: {result}</Text>
<TouchableOpacity
onPress={() => {
if (Platform.OS === 'android') {
initVerificationAndroid('');
// .then((res) => console.log(res))
// .catch((e) => {
// console.log(e);
// });
} else {
startMetricLauncherIOS('', undefined, undefined, false)
.then((res) => console.log(res))
.catch((e) => {
console.log(e);
});
}
}}
>
<Text>Start Launcher</Text>
</TouchableOpacity>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
box: {
width: 60,
height: 60,
marginVertical: 20,
},
});
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library