1.5.2 • Published 2 years ago

react-native-gainsight-px v1.5.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

React Native GainsightPX

1.3.0

  • Editor Product Mapper preview.

  • Release Notes:

    • Remove isReady in GainsightPX bridge file.

1.2.2

  • Release Notes:
    • Remove isReady in GainsightPX bridge file.

1.2.1

  • Release Notes:
    • Fix for tracking back button taps in iOS SDK.

1.2.0

  • Release Notes:
    • Introducing Editor to support preview engagements and map UI elements to features from mobile.
    • Scan QRCode from dashboard to preview engagements or create mapper feature.
    • Deprecated sharedInstance.
    • Supporting Bar type dialog engagements.
    • Fix for video in engagement by changing window level.
    • Fix for window access after completing engagement preview from editor.
    • Fix to block all the events when user is in editing mode.

0.1.8

  • Release Notes:
    • Added proxy to Configurations
    • Removed recordScreenViews from Configurations

Installation React Native

Download react-native-gainsight-px-1.0.0.tgz

Add dependencies to you project

 "dependencies": {
    ...,
    ...,
    "react-native-gainsight-px": "file:/<path-to>/react-native-gainsight-px-1.0.0.tgz"
  }

And

$ npm install

Or

In React-native project folder do

$ npm install <path-to-react-native-gainsight-px-1.0.0.tgz>

Installation iOS

Download GainsightPX.framework from url: <gainsight-framework-url>

In Xcode Make sure that you select target Add the framework to the Embedded Binaries

In terminal

$ cd <project-folder>
$ react-native run-ios

Installation Android

TODO:

Usage in React-Native

####Import

import { GainsightPX, Configurations, PXAccount, PXUser } from "react-native-gainsight-px";

####Configurations

TODO:

Initilisation

let c = new Configurations("<#API KEY#>");
c.enableLogs = true;
GainsightPX.getInstance().initialize(c);

Screen Event

Custom Screen

GainsightPX.getInstance().screenEvent("<#screen-name#>", "<#screen-class#>");

Only Screen Name

GainsightPX.getInstance().screen("<#screen-name#>", "<#map#>");

Custom Event

GainsightPX.getInstance().track("<#event-name#>", "<#map#>");

Internal

react-native-gainsight-px

publishing to Nexus

In package Root make sure you have .npmrc file

npm run release

local-linking

In package Root

npm run build

In Sample Application after npm install install the react-native-gainsight-px-1.0.0.tgz file

To install this file react-native-gainsight-px-1.0.0.tgz

$ cd RealSample
npm install ../react-native-gainsight-px-1.0.0.tgz

This command will add the path to the package.json in the Application

Getting started

Make sure you have .npmrc file

$ npm install react-native-gainsight-px --save

Mostly automatic installation

$ react-native link react-native-gainsight-px

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-gainsight-px and add RNGainsightPx.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNGainsightPx.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNGainsightPxPackage; to the imports at the top of the file
  • Add new RNGainsightPxPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-gainsight-px'
    project(':react-native-gainsight-px').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-gainsight-px/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-gainsight-px')

Usage

import RNGainsightPx from "react-native-gainsight-px";

// TODO: What to do with the module?
RNGainsightPx;