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
image.png

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.
image.png


中关村科金
136 声望13 粉丝

北京中关村科金技术有限公司(简称“中关村科金”)是国内领先的对话式AI技术解决方案提供商,成立于2014年,注册资本14亿元,总部位于北京,在上海、重庆、深圳、杭州、成都等地设有分支机构,公司规模近千人,其...