当前位置:网站首页>Product Description丨MobPush fast integration method on Android side

Product Description丨MobPush fast integration method on Android side

2022-08-10 17:48:00 InfoQ

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

Integration preparation

Register an account
Before using PushSDK, you need to register a developer account on the MobTech official website and obtain the AppKey provided by MobTechand AppSecret, details can be
Click to view the registration process
MobPush background configuration
After registering a MobTech account, it needs to be done in the MobTech backgroundFor the configuration of related information, for details, you can
click to view the specific configuration information
MobPush flow chart

Add configuration

Register MobSDK in 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 plugins and extensions to the Gradle file of the project App Module
// Call MobTech SDK
apply plugin: 'com.mob.sdk'

MobSDK {
appKey "replace with appkey"
appSecret"of MobTech's official applicationThe appSecret corresponding to the appkey officially applied by MobTech"
MobPush {}
}

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 is installed cold for the first time and obtainedAfter the user reads your "Privacy Policy" authorization, call MobSDK.submitPolicyGrantResult to return the privacy agreement authorization result.
On the contrary, 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 Guidelines
/**
* com.mob.MobSDK.class
* Returns the userPrivacy authorization result
* @param isGranted Whether the user agrees to the privacy agreement
*/
public static void submitPolicyGrantResult(boolean isGranted)
Sample code
 
Note
: The developer can specify the calling location, just call it before using the SDK function. It is strongly recommended that the developer click the application privacy agreement pop-up window at the end user.Called after agreeing the button.
MobSDK.submitPolicyGrantResult(true);
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208101724514292.html