jpush——极光推送

    xiaoxiao2021-03-25  6

    1:导依赖

    compile 'cn.jiguang.sdk:jpush:3.0.3' // 此处以JPush 3.0.3 版本为例。 compile 'cn.jiguang.sdk:jcore:1.1.1' // 此处以JCore 1.1.1 版本为例。 2:app build.gradle

    android { compileSdkVersion 25 buildToolsVersion "25.0.0" defaultConfig { applicationId "com.bawei.TopNews" minSdkVersion 15 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" ndk { //选择要添加的对应cpu类型的.so库。 abiFilters 'armeabi', 'armeabi-v7a', 'armeabi-v8a' // 还可以添加 'x86', 'x86_64', 'mips', 'mips64' } manifestPlaceholders = [ JPUSH_PKGNAME :applicationId, JPUSH_APPKEY : "be141595aeeff1c6b9f9a609", //JPush上注册的包名对应的appkey. JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. ] } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } repositories { flatDir { dirs 'libs' } } 3:全局 gradle.properties android.useDeprecatedNdk=true4:在MainActivity//初始化JPush JPushInterface.init(this); //设置debug模式 JPushInterface.setDebugMode(true);

    转载请注明原文地址: https://ju.6miu.com/read-163374.html

    最新回复(0)