最近碰到需要一个推送的需求,决定用第三方的友盟推送来实现功能,本程序只是友盟的简单集成,处理逻辑就是友盟的后台发送一条推送消息,在手机上进行接收。
1.效果图:后台效果图:
前端效果图:
2.添加依赖:app里面的build.gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//PushSDK必须依赖基础组件库,所以需要加入对应依赖
implementation 'com.umeng.umsdk:common:1.5.4'
//PushSDK必须依赖utdid库,所以需要加入对应依赖
implementation 'com.umeng.umsdk:utdid:1