Android简单版极光推送(赵智畏著)

android {
compileSdkVersion 28
defaultConfig {
applicationId “com.example.lenovo.myapplication”
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName “1.0”
testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner”
//极光推送开始
ndk {
//选择要添加的对应cpu类型的.so库
abiFilters ‘armeabi’, ‘armeabi-v7a’, ‘arm64-v8a’
// 还可以添加 ‘x86’, ‘x86_64’, ‘mips’, ‘mips64’
}

    manifestPlaceholders = [
            JPUSH_PKGNAME : applicationId,
            JPUSH_APPKEY : "5393955f7702d11d1237468e", //JPush上注册的包名对应的appkey.
            JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
    ]
    //机关推送结束
}

添加依赖

implementation 'cn.jiguang.sdk:jpush:3.1.1'  // 此处以JPush 3.1.1 版本为例。
implementation 'cn.jiguang.sdk:jcore:1.1.9'  // 此处以JCore 1.1.9 版本为例。

1
2
新建Application类

public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
JPushInterface.setDebugMode(true);
JPushInterface.init(this);
}
}

猜你喜欢

转载自blog.csdn.net/black_amber/article/details/90633821
今日推荐