@v4jk4kvjax/mipush-rn
v1.0.1
Published
A react native module for xiaomi push.
Downloads
2
Readme
mipush-rn
fork by https://github.com/Aicxz/react-native-xiaomi-push
安装
npm install @v4jk4kvjax/mipush-rn --save
or
yarn add @v4jk4kvjax/mipush-rn
集成
android/app/src/main/AndroidManifest.xml 添加配置
<!-- 小米推送 -->
<application>
<meta-data
android:name="XIAOMI_APPID"
android:value="appid=${XIAOMI_APPID}" />
<meta-data
android:name="XIAOMI_APPKEY"
android:value="appkey=${XIAOMI_APPKEY}" />
</application>
android/app/build.gradle 设置申请的AppId和AppKey
android {
defaultConfig {
manifestPlaceholders = [XIAOMI_APPID: XiaomiAppid as String, XIAOMI_APPKEY: XiaomiAppkey as String]
}
}
android/app/gradle.propertie 设置申请的AppId和AppKey
XiaomiAppid= 123456(小米开放平台申请的appid)
XiaomiAppkey= 123456(小米开放平台申请的appkey)
使用
import RNXiaomiPush from '@v4jk4kvjax/mipush-rn';
RNXiaomiPush.registerPush();
RNXiaomiPush.getRegId().then((regId) => {
alert(regId);
});