添加项目的buid.gradle
ndk {
//选择要添加的对应cpu类型的.so库
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
}
manifestPlaceholders = [
XG_ACCESS_ID:"2100332371",
XG_ACCESS_KEY : "ABRD93KT147K",
]
依赖
//采集安装列表
implementation 'com.tencent.xinge:xinge:3.1.2-a-alpha'
//wup包
implementation 'com.tencent.wup:wup:1.0.0.E-alpha'
//mid包
implementation 'com.tencent.mid:mid:3.9.0-alpha'
appliciaion中添加方法
private void initXGPush() {
XGPushConfig.enableDebug(this, true);
XGPushManager.registerPush(this, new XGIOperateCallback() {
@Override
public void onSuccess(Object o, int i) {
Log.e("TPush", "注册成功,设备token为:" + o);
}
@Override
public void onFail(Object o, int i, String s) {
Log.e("TPush", "注册失败,错误码:" + i + ",错误信息:" + s);
}
});
//设置账号
XGPushManager.registerPush(getApplicationContext(), "XINGE");
// 设置标签
XGPushManager.setTag(this, "XINGE");
}