import Aegis, { BUGLY_SERVER_HOST } from 'bugly-rn-sdk';// Optional. Used to obtain the device's network information.import netInfo from '@react-native-community/netinfo';const aegis = new Aegis({id: 'xxxx', // The app id of the integrated product. Required.appKey: 'xxxxxxx', // The app key of the integrated product. Required.aid: "deviceID", // The device ID. It should be unique for different devices. Recommended.env: "debug", // The log level for sdk console output. "debug" outputs all logs. The default value is "production", which outputs only error logs during sdk runtime. Optional.serverHost: BUGLY_SERVER_HOST.OA, // The reporting domain. Required.netInfo: netInfo, // Optional. Network information can be obtained after it is passed in.plugin:{error: true, // Enable error monitoring.}});
import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native';import { createNativeStackNavigator } from '@react-navigation/native-stack';function App() {const Stack = createNativeStackNavigator();const containerRef = useNavigationContainerRef();return (<NavigationContainerref = {containerRef}onReady={() => {// Enable the page visit feature using wrapNavigationRef.aegis.wrapNavigationRef(containerRef);}}><Stack.Navigator initialRouteName="Home"><Stack.Screen name="Home" component={HomeScreen} /></Stack.Navigator></NavigationContainer>);}
import { Navigation } from 'react-native-navigation';const aegis = new Aegis({// The configuration items are the same as those for SDK initialization.navigation: Navigation,});
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback