1.0.0 • Published 4 years ago

react-native-tingyunapp v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-native-tingyunapp

Getting started

$ npm install react-native-tingyunapp --save

Mostly automatic installation

$ react-native link react-native-tingyunapp

Manual installation

iOS

执行pod install 命令

Android

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

Usage

import {NBSAppAgent} from 'react-native-tingyunapp';

嵌码:
const nbsAppAgent = new NBSAppAgent()
nbsAppAgent.startWithOptions("appId","redirectURL",false,true)

设置UserID:
nbsAppAgent.setUserIdentifier("userId")

自定义错误:
try{
    console.log(abc)
}catch(e){
    nbsAppAgent.reportError("test",e,{"test":"tingyun"})
}
RNTingyunApp;