Ionic agent

Prerequisites

Cordova 10, Capacitor 5

Android

  • Android 8.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 Ionic dependency (Common for iOS & Android)

Run the following commands to set the appropriate registry, authenticate, and download SixthSense Ionic dependency.

npm config set @sixthsense:registry https://artifacts-observability.sixthsense.rakuten.com/api/v4/projects/57/packages/npm/
npm config set -- '//artifacts-observability.sixthsense.rakuten.com/api/v4/projects/57/packages/npm/:_authToken' "${PACKAGE_TOKEN}"
npm install @sixthsense/sixthsense-ionic-agent

SixthSense Ionic dependency will download in the node modules folder.

  1. Open the main.ts file and do the following changes:
import ClientMonitor from '@sixthsense/sixthsense-ionic-agent';

a. Add the following code in the main.ts file.

ClientMonitor.register({
service: "pass application name", // Name the app
collector: 'pass endpoint url',
serviceVersion: "pass app version",
authorization: "pass access token",});
  1. Create a new global-error-handler.ts file inside the Project/src/app folder and add the following code in the file.

(OPTIONAL - need to implement if global error handler not there(specific to angular)):

import { ErrorHandler, Injectable } from '@angular/core';
import ClientMonitor from '@sixthsense/sixthsense-ionic-agent';
//import ErrorHandler in app.module.ts
@Injectable()
export class GlobalErrorHandler implements ErrorHandler {
constructor() {}
handleError(error: any) {
ClientMonitor.reportSixthsenseFrameErrors( {
collector: "pass endpoint url",
service: "pass application name",
serviceVersion: "pass app version",
authorization: "pass access token"
}, error)
}
}
  1. Save all changes and perform ionic build.

IOS:

To implement SixthSenseMobileSDK.

a. Open the xcworkspace file in X-Code.

b. Open the Podfile inside the Pods folder and add pod 'SixthSenseMobileSDK'.

c. Open the Project in terminal and run pod update command. It will download the SixthSenseMobileSDK file in the Sample app.

d. Go to AppDelegate class and import SixthSenseMobileSDK. Initialise SDK in didDinishLaunching function with the following code.

SixthSenseMobile.shared.initSixthSenseMobileSDK()

e. Open the Info.plist file and add the "AccessToken" key as a string and also add the value for the same.

f. Open the Info.plist file and add "EndPointName" key as a string and also add the value "https://http-collector-observability.sixthsense.rakuten.com/poc-mobile/"

Testing the build

You are now in an Xcode workspace for building, debugging, and testing the Mobile Monitoring capability.

  1. For force crash, import SixthSenseMobileSDK in any View Controller class and call fatalError().
  2. Run the application in simulator/device and try to make the application crash. After crashing, relaunch the application in simulator/device.
  3. Open the Mobile Monitoring dashboard and go to the Mobile Monitoring tab and check the crash logs and other matrices.