Development tools: Android Studio
Integration method: Gradle online integration
Android version support: minSdkVersion 19
Preparation for integration
Register an account
Before using PushSDK, you need to register a developer account on the MobTech official website and obtain the AppKey and AppSecret provided by MobTech. For details, you can click to view the registration process
MobPush background configuration
After registering a MobTech account, you need to configure the relevant information in the MobTech background. For details, you can click to view the specific configuration information
MobPush flow chart
add configuration
Register MobSDK in project Gradle file
buildscript {
repositories {
// 添加MobSDK Maven地址
maven {
url "https://mvn.mob.com/android"
}
}
dependencies {
// 注册MobSDK
classpath "com.mob.sdk:MobSDK:2018.0319.1724"
}
}
allprojects {
repositories {
// 添加MobSDK Maven地址
maven {
url "https://mvn.mob.com/android"
}
}
Add plugins and extensions to the Gradle file of the project App Module
// 调用MobTech SDK
apply plugin: 'com.mob.sdk'
MobSDK {
appKey "替换为MobTech官方申请的appkey"
appSecret "替换为MobTech官方申请的appkey对应的appSecret"
MobPush {}
}
Add code in gradle.properties
MobSDK.spEdition=FP
Returns the user privacy authorization result (submitPolicyGrantResult)
To ensure that your app can meet the relevant compliance requirements of the Ministry of Industry and Information Technology after integrating MobSDK, you should ensure that the app is installed cold for the first time and after obtaining the user's authorization to read your "Privacy Policy", call MobSDK.submitPolicyGrantResult to return the privacy agreement authorization result.
On the other hand, if the user does not agree with the authorization of your App's "Privacy Policy", he cannot call MobSDK.submitPolicyGrantResult to return the privacy agreement authorization result. Please refer to the link compliance guide
Sample code Note: Developers can specify the calling location by themselves. They only need to call before using the SDK function. It is strongly recommended that developers call after the end user clicks the consent button in the application privacy agreement pop-up window.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。