# Extension SDK
In addition to the core SDK, we also provide the Extension SDK, which is a library dependent on the core SDK and offers various Mini-Program APIs not available in the core SDK.
The reason for providing the Extension SDK is to ensure that the core SDK remains lightweight while still offering a rich set of Mini-Program APIs. The core SDK is responsible for establishing the foundational framework for running Mini-Programs and providing a small set of essential APIs. In terms of permissions, it only retains basic permissions such as storage, camera, and location, with a size of just over 1MB. The Extension SDK exists as a supplement to the core SDK, and its APIs will continue to be enriched and improved.
To integrate the following Extension SDKs, you need to first place the Extension SDK (opens new window) in the plugin directory and call the following method during SDK initialization to register it.
# 1 Register Extension SDK
Example
MopSdk.registerExtSDK()
# 2 Register Map SDK (Choose One of Three)
Add map dependencies for Android plugins
// Add dependencies in the dependencies section of the plugin's package.json
"com.google.android.material:material:1.0.0"
// Choose one of the following map-related dependencies. If your app already includes a map module, no need to add the following.
// AMap (recommended not to use versions lower than the following to avoid class/method errors)
"com.amap.api:3dmap:8.0.0" // Can be replaced with your required version
"com.amap.api:location:5.5.1" // Can be replaced with your required version
"com.amap.api:search:7.9.0" // Can be replaced with your required version
// Baidu (recommended not to use versions lower than the following to avoid class/method errors)
"com.baidu.lbsyun:BaiduMapSDK_Map:7.4.0" // Can be replaced with your required version
"com.baidu.lbsyun:BaiduMapSDK_Location:9.1.8" // Can be replaced with your required version
"com.baidu.lbsyun:BaiduMapSDK_Search:7.4.0" // Can be replaced with your required version
// Tencent (recommended not to use versions lower than the following to avoid class/method errors)
"com.tencent.map:tencent-map-vector-sdk:4.5.9" // Can be replaced with your required version
"com.tencent.map.geolocation:TencentLocationSdk-openplatform:7.4.9" // Can be replaced with your required version
// Google
"com.google.android.gms:play-services-maps:16.1.0" // Can be replaced with your required version (recommended to use this version, versions above are not supported)
"com.google.android.gms:play-services-location:16.0.0" // Can be replaced with your required version (recommended to use this version, versions above are not supported)
# 2.1 Register Baidu Map SDK
Example
MopSdk.registerBDMapSDK(key)
Parameters
| Configuration Name | Type | Description |
|---|---|---|
| key | String | Baidu key |
# 2.2 Register AMap SDK
Example
MopSdk.registerGDMapSDK(key)
Parameters
| Configuration Name | Type | Description |
|---|---|---|
| key | String | AMap key |
# 2.3 Register Tencent Map SDK
Example
MopSdk.registerTXMapSDK(key)
Parameters
| Configuration Name | Type | Description |
|---|---|---|
| key | String | Tencent key |
# 3 Register Bluetooth SDK
Example
MopSdk.registerBluetoothSDK()
# 4 Register Contact SDK
Example
MopSdk.registerContactSDK()
# 5 Register Clipboard SDK
Example
MopSdk.registerClipboardSDK()
# 6 Register Live SDK
Example
// Initialization settings
MopSdk.initialize({
...,
uiConfig: {
useNativeLiveComponent: true
}
},
(ret) => {
console.log('App Launch Success', ret)
// Register
MopSdk.registerLiveSDK()
},
(ret) =>{
console.log('App Launch Fail', ret)
});
# 7 Register Calendar SDK
Example
MopSdk.registerCalendarSDK()