react-native-defaultify
v1.0.1
Published
React Native bridge module for interacting with defaultify
Downloads
53
Readme
react-native-defaultify
React Native bridge module for interacting with defaultify
Installation
npm install react-native-defaultify
Usage
import * as React from 'react';
import {
launchDefaultify,
crashInitialise,
NetworkLog,
} from 'react-native-defaultify';
// ...
const navigationRef = React.useRef(); // create ref for navigation
if (Platform.OS == 'ios') {
launchDefaultify('<IOS-APP-TOKEN>');
} else if (Platform.OS === 'android') {
launchDefaultify('<ANDROID-APP-TOKEN>');
}
React.useLayoutEffect(() => {
NetworkLog();
}, []);
React.useEffect(() => {
crashInitialise(navigationRef); // Pass reference of navigation
}, []);
return (
<NavigationContainer ref={navigationRef}>
<Stack.Navigator initialRouteName="screen1">
<Stack.Screen name="screen1" component={screen1} />
<Stack.Screen name="screen2" component={screen2} />
</Stack.Navigator>
</NavigationContainer>
);
Requirements
For android minSdkVersion 24 is required.
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library