React Native agent
Prerequisites
- react-native >= 0.65.0
Android
- Android 5.0 or higher - min SDK 21
- Android Gradle Plugin - 4.2.0+
- Gradle version - 6.7.1+
IOS
- Mac OS 10.15.7 and above
- iOS 12 and above
- Download Install X-Code 12.2 and above
- Install cocoa pods in system
Adding SixthSense React Native dependency for iOS and Android
Run the following commands to set the appropriate registry, authenticate, and download SixthSense react native dependency.
Android
To install SixthSense Mobile Monitoring Android SDK, add the dependency to your build.gradle file dependencies block.
Add the following lines to the repositories block for downloading dependencies.
Configuration is done via the AndroidManifest.xml file.
- Configure the Access Token in the application tag.
You can find the Access Token from the SixthSense dashboard. Navigate to Settings > General > Access token
- Similarly configure reporting base URL.
For OneCloud Platform, use the following commnad:
Initialize SSObservability in the OnCreate callback of your MainApplication.java.
This will capture crashes and ANRs and list them on the dashboard. To report handled exceptions in native (Java) code, use SSLogger as follows.
To report errors from the javascript code do the following.
To automatically capture http requests made using Fetch API, add the following to the buildscript dependencies block.
Apply the plugin in the module level build.gradle.
Requirements for the above http clients auto instrumentation are as follows:
- Android Gradle Plugin - 7.1+
- Gradle version - 7.2+
IOS
Implementing the mobile agent
- Open xcworkspace file in X-Code.
- Open Podfile inside the Pods folder and add the 'SixthSenseMobileSDK' pod.
- Open the project in a terminal and run the pod update command. It will download the SixthSenseMobileSDK in Sample application.
- Go to AppDelegate class and import SixthSenseMobileSDK.
- Initialise SDK in didDinishLaunching function with following code.
- Open the Info.plist file and add the "AccessToken" key as a string and also add the value.
- Open Info.plist file and add "EndPointName" key as a string and also add the value "https://http-collector-observability.sixthsense.rakuten.com/poc-mobile/".
For OneCloud Platform use, Open the Info.plist file and add "EndPointName" key as a string and also add the value "https://sixthsense-backend.jpe2-caas1-prod1.caas.jpe2b.r-local.net/mobile".
Testing the mobile agent
You are now in an Xcode workspace for building, debugging, and testing Mobile Monitoring.
- For force crash, import SixthSenseMobileSDK in any View Controller class and call fatalError().
- Run the application in a simulator/device and make the application crash. After crashing, relaunch the application in the simulator/device.
- Navigate to Mobile monitoring dashboard from the SixthSense portal and check the crash logs and other matrices.