配置

新版AndroidStudio AndroidManifest.xml文件分为2个 release版本和debug版本注意都要添加权限

                 

项目的build.gradle 要添加资源库

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    ext {        buildToolsVersion = '28.0.3'        minSdkVersion = 16        compileSdkVersion = 28        targetSdkVersion = 28        supportLibVersion = '28.0.0'    }    repositories {        google()        jcenter()        maven { url 'https://dl.bintray.com/umsdk/release' } //这里    }    dependencies {        classpath("com.android.tools.build:gradle:3.4.1")        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}allprojects {    repositories {        mavenLocal()        maven {            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm            url("$rootDir/../node_modules/react-native/android")        }        maven {            // Android JSC is installed from npm            url("$rootDir/../node_modules/jsc-android/dist")        }        google()        jcenter()        maven { url 'https://dl.bintray.com/umsdk/release' }//这里    }}

添加依赖注意根据自己情况增删

    //PushSDK必须依赖基础组件库,所以需要加入对应依赖    implementation 'com.umeng.umsdk:common:2.0.0'//PushSDK必须依赖utdid库,所以需要加入对应依赖    implementation 'com.umeng.umsdk:utdid:1.1.5.3'//PushSDK    implementation 'com.umeng.umsdk:push:6.0.1'//官方React Native的例子里有使用这里面的代码    implementation 'com.umeng.umsdk:analytics:8.0.0'

js端 具体里面的方法可以查看官方文档

var { NativeModules } = require('react-native');module.exports = NativeModules.UMAnalyticsModule;
var { NativeModules } = require('react-native');module.exports = NativeModules.UMAnalyticsModule;
var { NativeModules } = require('react-native');module.exports = NativeModules.UMAnalyticsModule;

更多相关文章

  1. 获取android配置文件的版本信息
  2. android开发环境类错误
  3. 提示Android(安卓)requires compiler compliance level 5.0 or 6
  4. Android版本更新实例详解
  5. 解决办法:Android(安卓)Studio报错“Error:Failed to open zip fi
  6. Android(安卓)8.0通知不显示
  7. Android(安卓)App 隐藏显示标题栏、状态栏、导航栏
  8. Android当前版本使用分布情况
  9. Libcurl库移植指南(上)--OpenSSL库移植

随机推荐

  1. Cocos2d-x 3.2导入到Eclipse后出现The im
  2. Android实现来电自动挂断实现机制
  3. Android(安卓)基础shape
  4. Android开发学习笔记2---HelloWord安卓程
  5. Android(安卓)- android.process.media意
  6. javap -s 查看java方法签名
  7. Android(安卓)LitePal介绍与使用说明
  8. android 添加核心层服务
  9. Android——调用系统摄像头拍照的问题
  10. android 布局方式 像素单位