MobTech SMSSDK Android Quick Integration Guide

Time:2022-11-26

Development tools: Android Studio
Integration method: Gradle online integration
Android version support: minSdkVersion 19

Preparations before integration

Before registering an account and using SMSSDK, you need to register a developer account on the MobTech official website, add an application and obtain the AppKey and AppSecret provided by MobTech. For details, please click to view the registration process
SMSSDK flow chart
MobTech SMSSDK Android Quick Integration Guide

Add configuration to register MobSDK in the project Gradle file
buildscript {
    repositories {
        // Add MobSDK Maven address
        maven {
           url "https://mvn.mob.com/android"
        }
    }
    dependencies {
        // Register MobSDK
        classpath "com.mob.sdk:MobSDK:2018.0319.1724"
    }
}

allprojects {
    repositories {
    // Add MobSDK Maven address
    maven {
        url "https://mvn.mob.com/android"
    }
}

Add the plugin and extend the apply plugin to the Gradle file of the project App Module:

'com.mob.sdk'
MobSDK {
    appKey "your appkey"
    appSecret "your appsecrt"
    SMSSDK {}
  }

Add code in gradle.properties
MobSDK.spEdition=FP

Return the user privacy authorization result (submitPolicyGrantResult)

In order 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 installation is cold-started for the first time and after obtaining authorization from the user to read your “Privacy Policy”, call MobSDK.submitPolicyGrantResult to return the privacy agreement authorization result. Conversely, if the user does not agree to your app’s “Privacy Policy” authorization, you cannot call MobSDK.submitPolicyGrantResult to return the privacy agreement authorization result.Please refer to the Link Compliance Guidelines

/**
 * com.mob.MobSDK.class
 * Return the user privacy authorization result
 * @param isGranted Whether the user agrees to the privacy agreement
 */  
public static void submitPolicyGrantResult(boolean isGranted)

sample code

Developers can specify the call location by themselves, and only need to call it before using the SDK function. It is strongly recommended that the developer call it after the end user clicks the consent button in the application privacy agreement pop-up window.
MobSDK.submitPolicyGrantResult(true);

Recommended Today

Install OpenSSH on Windows Server 2012

Install OpenSSH Server/Client on Windows Server.[1] Visit the following website and download OpenSSH. Usually on Windows 2012R2, select [OpenSSH-Win64.zip] to download. ⇒https://github.com/PowerShell/Win32-OpenSSH/releases[2] Extract the ZIP file and move the extracted folder to any location you like. This example shows putting in [C:\Program Files\] as shown below. [3] Open [System Properties], and click the [Environment Variables] […]