Android集成友盟消息推送SDK

本文详细介绍了如何在Android应用中集成友盟消息推送SDK,包括申请AppKey、添加依赖、初始化SDK、引入接口及进行消息推送测试的步骤。确保遵循每个步骤,以成功实现消息推送功能。
摘要由CSDN通过智能技术生成

消息推送SDK快速集成:

申请AppKey ——> 接入Push SDK ——> 基础接口引入 ——> 消息推送测试 ——> 接入完成

1.申请AppKey
在这里插入图片描述
在这里插入图片描述
2.接入Push SDK

1)、加入依赖

//友盟push相关依赖(必须)

implementation'com.umeng.umsdk:push:6.1.0'

implementation'com.umeng.umsdk:alicloud-httpdns:1.2.5'

implementation'com.umeng.umsdk:alicloud-utils:1.1.5'

implementation'com.umeng.umsdk:alicloud_beacon:1.0.1'

implementation'com.umeng.umsdk:agoo-accs:3.3.8.8-open-fix2'

implementation'com.umeng.umsdk:agoo_networksdk:3.5.5'

implementation'com.umeng.umsdk:agoo_tlog:3.0.0.17'

implementation'com.umeng.umsdk:agoo_tnet4android:3.1.14.9'

implementation'com.umeng.umsdk:asms:1.1.3'

implementation'com.umeng.umsdk:crash:0.0.4'

2)、在工程build.gradle配置脚本中buildscript和allprojects段中添加【友盟+】sdk 新maven仓库地址

buildscript {
   

    repositories {
   

        google()

        jcenter()

        maven {
    url 'https://dl.bintray.com/umsdk/release' }

    }

    dependencies {
   

        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong

        // in the individual module build.gradle files

    }

}

allprojects {
   

    repositories {
   

        google()

        jcenter()

        mavenCentral()

        maven {
    url 'https://dl.bintray.com/umsdk/release' }

    }

}

3)、在AndroidManifest.xml文件中引入相关基础组件:

<!-- 以下为基本配置信息,需要自行添加至您的AndroidManifest文件中 start-->

<service

        android:name="com.taobao.accs.ChannelService"

        android:exported="true"

        android:process=":channel">

        <intent-filter>

            <action android:name="com.taobao.accs.intent.action.SERVICE" />

        </intent-filter>

        <intent-filter>

            <action android:name="com.taobao.accs.intent.action.ELECTION" />

        </intent-filter>

    </service>

    <service

        android:name="com.taobao.accs.data.MsgDistributeService"

        android:exported="true">

        <intent-filter>

            <action android
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值