ipush
Getting started
$ npm install @aks-dev/ipush --save
or
$ yarn add @aks-dev/ipush
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-ipush
and addRNIpush.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNIpush.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- 打开
project
下面build.gradle
文件。
buildscript {//这里是gradle脚本执行所需依赖,分别是对应的maven库和插件
repositories {
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
}
}
allprojects {
repositories {
flatDir { dirs project(':aks-dev_ipush').file('libs') }
maven { url 'https://developer.huawei.com/repo/' }
}
}
- 打开
app
下面build.gradle
文件。
apply plugin: "com.android.application"
下面添加
apply plugin: "com.huawei.agconnect"
-
app
下面添加agconnect-services.json
Usage
import * as RNIpush from 'react-native-ipush';
// TODO: What to do with the module?
RNIpush;