Socket
Socket
Sign inDemoInstall

apxor-react-native-sdk

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apxor-react-native-sdk

Apxor react native analytics SDK


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

apxor-react-native-sdk

Getting started

$ npm install apxor-react-native-sdk --save

Mostly automatic installation

$ react-native link apxor-react-native-sdk

Manual installation

Android
  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.apxor.reactnativesdk.ApxorReactNativeSdkPackage; to the imports at the top of the file
  • Add new ApxorReactNativeSdkPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':apxor-react-native-sdk'
    project(':apxor-react-native-sdk').projectDir = new File(rootProject.projectDir, 	'../node_modules/apxor-react-native-sdk/android')
    

Additional steps todo

  1. Insert the following lines inside repositories block in android/build.gradle

      maven { url "http://repo.apxor.com/artifactory/list/libs-release-android/" }
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:

      compile project(':apxor-react-native-sdk')
      implementation 'com.apxor.android:apxor-android-sdk-core:2.3.7@aar'
    
  3. Insert the following lines in the onCreate method in android/app/src/main/java/(package)/MainApplication.java:

    ApxorSDK.initialize("<APP_ID>", MainApplication.this);
    

    Note:

    • The second argument, MainApplication.this, makes sures to provide ApplicationContext instead of ReactApplicationContext for ApxorSDK to work properly.
    • If you change the application class name (default: MainApplication), make sure to use your_class_name.this instead.

Push Notification Module (Optional)

  1. Insert the following lines inside the dependencies block in android/app/build.gradle:

      implementation 'com.apxor.android:apxor-android-sdk-push:1.1.5@aar'
      implementation 'com.google.firebase:firebase-messaging:11.4.0'
    
  2. Insert the following piece of code in the onMessageReceived(RemoteMessage) function

      if (ApxorPushAPI.isApxorNotification(message)) {
          ApxorPushAPI.handleNotification(message, getApplicationContext());
      }
    

Usage

import ApxorReactNativeSdk from 'apxor-react-native-sdk';
UserId:
ApxorReactNativeSdk.setUserIdentifier("user_id");
Example
ApxorReactNativeSdk.setUserIdentifier("<some_user_id>");
Events:
ApxorReactNativeSdk.logAppEvent(event_name, properties);
Example
ApxorReactNativeSdk.logAppEvent("ADD_TO_CART", {
    "userId": "user@example.com",
    "value": "1299",
    "item": "Sony Head Phone 1201" 
});
User Properties:
ApxorReactNativeSdk.setUserCustomInfo(properties);
Example
ApxorReactNativeSdk.setUserCustomInfo({
    "property1": "value",
    "property2": "value2"
});
Track Navigation:
ApxorReactNativeSdk.logNavigationEvent(screen_name);
Example
ApxorReactNativeSdk.logNavigationEvent("LoginScreen");

Keywords

FAQs

Package last updated on 24 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc