Many APIs that require system authorization for development and use need to be pre-authorized in the info.plist file of the project. However, your app may not need this feature, so the SDK has been split into core and extension modules, eliminating unnecessary permissions and reducing the size of the core module.
The SDK engine provides both core and extension modules, allowing users to integrate based on their specific needs.
Integration and usage of extension SDKs
The extension SDK complements the core SDK, so to use the extension SDK, you must also depend on the core SDK. This separation ensures the security and stability of the SDK by placing APIs that require permissions into the extension SDK.
TCMPPSDKExtMedia module provides the default implementations for the three APIs: chooseMedia, chooseVideo, and chooseImage. If your host app already has these capabilities, it is recommended to implement them in your open APIs. However, if you need to use the multimedia selection plugin provided by the platform, you will need to integrate this extension module.
How to use:
pod 'TCMPPSDK'
pod 'TCMPPSDKExtMedia'
Add following lines to the info.plist file:Privacy - Photo Library Usage Description
After the Media extension SDK is added, the supported mini program APIs are as follows:
|
wx.chooseMedia | Selects an image or video. |
wx.chooseVideo | Selects a video. |
wx.chooseImage | Selects an image. |
Required permissions:
|
Gallery access | Required to access the gallery. |
TCMPPExtScanCode
TCMPPSDKExtScanCode module provides the processing logic for wx.scanCode. If the host app has code scanning and recognition capabilities, it is recommended to integrate them through:
TMFMiniAppSDKDelegate.scanCode:(NSDictionary *)scanPrams navigationController:(UINavigationController *)navigationController completionHandler:(MACommonCallback)completionHandler;
However, if you need to use the code scanning feature provided by the platform, you need to use this plugin.
How to use:
pod 'TCMPPSDK'
pod 'TCMPPSDKExtScanCode'
Add following lines to the info.plist file:Privacy - Camera Usage Description
After the QR code scanning extension SDK is added, the supported mini program APIs are as follows:
|
wx.scanCode | Opens the client's image that has the QR code for scanning. |
Required permissions:
|
Camera | Required for QR code scanning. |
Gallery access | Required to access the gallery. |
TCMPPExtQMap
TCMPPSDKExtQMap module provides Tencent Maps SDK capabilities to users in the Chinese mainland.
How to use:
Apply for an app key on the Tencent Map open platform and set it in your code:
[TMFAppletQMapComponent setQMapApiKey:@"XXXXXXXXXXX"];
TCMPPExtBaiduMap
TCMPPSDKExtBaiduMap module provides Baidu Maps SDK capabilities to users in the Chinese mainland.
How to use:
Apply for an app key on the Baidu Maps open platform and set it in your code:
[TMFAppletBaiduMapComponent setBaiduMapApiKey:@"XXXXXXXXXXX"];
TCMPPExtAMap
TCMPPExtAMap module provides Amap SDK capabilities to users in the Chinese mainland.
How to use:
Apply for an app key on the Amap open platform and set it in your code:
[TMFAppletAMapComponent setAMapApiKey:@"XXXXXXXXXXX"];
After adding extension SDKs of Tencent Maps, Baidu Maps, and Amap, the supported mini program APIs are as follows:
|
Map | Supports map APIs, including map display, location selection, and POI query, etc. |
Required permissions:
|
Location permission | Required for displaying map locations. |
TCMPPExtLive
If you need to use the live streaming components (live-player and live-pusher) for developing capabilities of live streaming push and pull, you need to add the following SDKs.
pod "TCMPPSDKExtLive"
pod 'TXLiteAVSDK_Professional', :podspec => 'https://liteav.sdk.qcloud.com/pod/liteavsdkspec/TXLiteAVSDK_Professional.podspec'
In addition to adding the above dependencies, you need to implement the following methods in TMFMiniAppSDKDelegate to provide the LicenseUrl and LicenseKey required for the live streaming component. This is necessary to complete the initialization configuration for the live streaming component. If you do not configure the correct LicenseUrl and LicenseKey, the live streaming component will not function properly.
- (NSString *)setLiveLicenceURL {
return @"https://xxx.license";
}
- (NSString *)setLiveLicenceKey {
return @"xxx";
}
Add following lines to the info.plist file:
Privacy - Camera Usage Description
Privacy - Microphone Usage Description
After the live streaming extension SDK is added, the supported mini program APIs are as follows:
|
wx.createLivePusherContext | Creates the live streaming pusher context. |
LivePusherContext | Supports LivePusherContext APIs. |
wx.createLivePlayerContext | Creates a live streaming player context. |
LivePlayerContext | Supports LivePlayerContext APIs. |
Component | - |
live-pusher | Tag for live streaming push. |
live-player | Tag for live streaming play. |
Required permissions:
TCMPPExtAuthentication
TCMPPExtAuthentication module provides capabilities related to biometric authentication.
Integration method:
pod
"TCMPPExtAuthentication"
How to use:
Add following lines to the info.plist file:Privacy - Face ID Usage Description
After the biometric authentication extension SDK is added, the supported mini program APIs are as follows:
|
wx.startSoterAuthentication | - |
wx.checkIsSupportSoterAuthentication | - |
wx.checkIsSoterEnrolledInDevice | - |
Required permissions:
|
Biometric authentication access | Requires the biometric authentication permission. |
TCMPPExtBLE
TCMPPExtBLE module provides Low Energy (BLE) Bluetooth and beacon related capabilities.
Integration method:
How to use:
Add following lines to the info.plist file:
Privacy - Bluetooth Always Usage Description
Privacy - Bluetooth Peripheral Usage Description
After the LBS extension SDK is added, the supported mini program APIs are as follows:
|
Bluetooth - general | General Bluetooth API. |
Bluetooth - Low Energy (BLE) peripheral device | Bluetooth Low Energy (BLE) peripheral devices APIs. |
Bluetooth-Low Energy (BLE) central device | Center device APIs. |
Bluetooth-beacon | Bluetooth beacon APIs. |
Required permissions:
|
Bluetooth | Required to operate the Bluetooth. |
Location permission | Required to search the Bluetooth device. |
TCMPPExtCalendar
TCMPPExtCalendar module provides calendar-related capabilities.
Integration method:
How to use:
Add following lines to the info.plist file:
Privacy - Calendars Usage Description
Privacy - Reminders Usage Description
API list:
|
addPhoneRepeatCalendar | Adds recurring events to the system calendar. |
addPhoneCalendar | Adds events to the system calendar. |
TCMPPExtClipBoard
TCMPPExtClipBoard module provides clipboard-related capabilities.
Integration method:
API list:
|
setClipboardData | Sets the content of the system clipboard. |
getClipboardData | Gets the content of the system clipboard. |
TCMPPExtContact
TCMPPExtContact provides contact-related capabilities.
Integration method:
How to use:
Add following lines to the info.plist file:Privacy - Contacts Usage Description
API list:
|
chooseContact | Selects a contact. |
addPhoneContact | Adds contacts to mobile phone contacts. |
TCMPPExtLBS
TCMPPExtLBS module provides system positioning, system map, compass, accelerometer, device orientation, and gyroscope related capabilities.
Integration method:
How to use:
Add following lines to the info.plist file:
Privacy - Location Always and When In Use Usage Description
Privacy - Location Always Usage Description
Privacy - Location Usage Description
Privacy - Location When In Use Usage Description
Privacy - Motion Usage Description
API list:
|
Location permission | Refer to Location. |
System map | Refer to Map Component. |
Compass, accelerometer, device motion, gyroscope | Refer to Compass, Accelerometer, Device Motion, Gyroscope. |
TCMPPExtMDNS
TCMPPExtMDNS module provides the capabilities to communicate over a LAN.
Integration method:
How to use:
Add following lines to the info.plist file:
Privacy - Local Network Usage Description
Privacy - Bonjour services
API list:
TCMPPExtNetwork
TCMPPExtNetwork module provides the capabilities for TCP/UDP communication.
Integration method:
How to use:
Add following lines to the info.plist file:
App Transport Security Settings
Allow Arbitrary Loads - YES
Privacy - Bonjour services
API list:
|
TCP | Refer to TCP Communication. |
UDP | Refer to UDP Communication. |
TCMPPExtMp3Encoder
TCMPPExtMp3Encoder module provides the capabilities to save files in MP3 format when using RecorderManager.
Integration method:
How to use:
The MP3 saving feature provided by the platform depends on the Lame library. The Lame library is open-source and licensed under the GNU Library or Lesser General Public License version 2.0 (LGPLv2), GNU General Public License version 2.0 (GPLv2). For more information, see: LAME. You can integrate it as needed.
TCMPPExtMiniGame
TCMPPExtMiniGame module provides the capabilities to run mini games.
Integration method:
How to use:
Note that TCMPPExtMiniGame currently only supports running and debugging on real devices. It does not support running on simulators.
TCSASExtGoogleAds
TCSASExtGoogleAds provides support for loading GoogleAdmob ads.
Integration method:
How to use:
Note that this feature depends on Admob. Please follow the official documentation to access Admob.