In development and usage, many system-authorized APIs require preset authorization in the project's info.plist file. However, your app might not need these features. Therefore, the TCMPP SDK splits out an extension SDK, eliminating unnecessary authorizations and reducing the core module size.
The TCMPP SDK engine provides both core and extension modules, allowing users to integrate based on their needs.
Connect to and use extended SDKs
The mini program engine classifies SDKs into the core SDK and extended SDKs, and the latter is the supplement to the former. Therefore, extended SDKs need to depend on the core SDK. To guarantee the SDK security and stability, you should place APIs requiring permissions in extended SDKs as much as possible.
`TCMPPSDKExtMedia` provides the default implementations of three APIs: `chooseMedia`, `chooseVideo`, and `chooseImage`. If the host app already has these capabilities, we recommend you implement them in open APIs. To use the media selection feature provided by TMF, you need to use this plugin.
Usage
pod 'TCMPPSDK'
pod 'TCMPPSDKExtMedia'
Add the following in info.plist file: Privacy - Photo Library Usage Description
After adding the Media extended SDK, the supported mini program API list is as follows:
|
wx.chooseMedia | select a photo or video |
wx.chooseVideo | Select a video |
wx.chooseImage | Select a photo |
Permissions involved:
|
Album access permissions | Requires permissions to access the album |
TCMPPExtScanCode
`TCMPPSDKExtScanCode` provides the processing logic for `wx.scanCode`. If the host app has code scanning and recognition capabilities, we recommend you use the following code to connect to the existing code scanning module:
TMFMiniAppSDKDelegate.scanCode:(NSDictionary *)scanPrams navigationController:(UINavigationController *)navigationController completionHandler:(MACommonCallback)completionHandler;
To use the code scanning feature provided by TCMPP, you need to use this plugin.
Usage:
pod 'TCMPPSDK'
pod 'TCMPPSDKExtScanCode'
Add the following in info.plist file: Privacy - Camera Usage Description
After adding the Scan Code extended SDK, the supported mini program API list is as follows:
|
wx.scanCode | Invokes the client's code scanning UI to scan a code |
Permissions involved:
|
Camera permission | Requires camera access for scanning codes |
Gallery access rights | You need to request access to the gallery |
TCMPPExtQMap
TCMPPSDKExtQMap provides Tencent Map SDK capabilities for users in Chinese mainland.
Usage:
Apply for an appkey on Tencent Maps Open Platform and set it in the code:
[TMFAppletQMapComponent setQMapApiKey:@"XXXXXXXXXXX"];
TCMPPExtBaiduMap
TCMPPSDKExtBaiduMap provides the capabilities of the Baidu Maps SDK for users in mainland China.
Usage:
Apply for an appkey on the Baidu Map open platform and set it in the code:
[TMFAppletBaiduMapComponent setBaiduMapApiKey:@"XXXXXXXXXXX"];
TCMPPExtAMap
TCMPPSDKExtBaiduMap provides users in mainland China with relevant capabilities of the Gode Map SDK.
Usage:
Apply for appkey in the Gaode map open platform and set it in the code:
[TMFAppletAMapComponent setAMapApiKey:@"XXXXXXXXXXX"];
After adding the Tencent, Baidu, and AMap extended SDKs, the supported mini program API list is as follows:
|
Map | Supports map-related APIs, including map display, location selection, and POI queries |
Permissions involved:
|
Locationa | Requires location access for map display and positioning |
TCMPPExtLive
If you need to use live components (live-player and live-pusher) for live streaming scenarios, you need to add the following SDKs to support the live component functionalities.
pod "TCMPPSDKExtLive"
pod 'TXLiteAVSDK_Professional', :podspec => 'https://liteav.sdk.qcloud.com/pod/liteavsdkspec/TXLiteAVSDK_Professional.podspec'
In addition to adding the above dependencies, you also need to implement the following methods in TMFMiniAppSDKDelegate to provide the LicenseUrl and LicenseKey required by the live component for initialization. If you do not configure the correct LicenseUrl and LicenseKey, the live component functionality will be unavailable.
- (NSString *)setLiveLicenceURL {
return @"https://xxx.license";
}
- (NSString *)setLiveLicenceKey {
return @"xxx";
}
Add the following in info.plist file:
Privacy - Camera Usage Description
Privacy - Microphone Usage Description
After adding the Live extension SDK, the supported mini program API list is as follows:
|
wx.createLivePusherContext | Creates a live streaming pusher context. |
LivePusherContext | Supports APIs related to LivePusherContext |
wx.createLivePlayerContext | Creates a live streaming player context |
LivePlayerContext | Supports APIs related to LivePlayerContext |
Components | - |
live-pusher | Tag for pushing |
live-player | Tag for playing |
Permissions involved:
|
Camera permission | - |
Recording permission | - |
TCMPPExtAuthentication
TCMPPExtAuthentication provides capabilities related to biometric authentication.
Usage:
pod
"TCMPPExtAuthentication"
Usage
Add the following in info.plist file: Privacy - Face ID Usage Description
After adding the biometric authentication extended SDK, the supported mini program API list is as follows:
|
wx.startSoterAuthentication | - |
wx.checkIsSupportSoterAuthentication | - |
wx.checkIsSoterEnrolledInDevice | - |
Permissions involved:
|
Biometric authentication access | Requires biometric authentication permission |
TCMPPExtBLE
TCMPPExtBLE provides capabilities related to low-energy Bluetooth and beacons.
Usage:
Add the following in info.plist file:
Privacy - Bluetooth Always Usage Description
Privacy - Bluetooth Peripheral Usage Description
After adding the LBS extended SDK, the supported mini program API list is as follows:
|
Bluetooth - general | General Bluetooth APIs |
Bluetooth - Low energy peripherals | APIs related to peripheral devices |
Bluetooth - Low energy central | APIs related to central devices |
Bluetooth - Beacon | APIs related to Bluetooth beacons |
Permissions involved:
|
Bluetooth | Required for Bluetooth operations |
Location | Required for Bluetooth device search |
TCMPPExtCalendar
TCMPPExtCalendar provides calendar-related capabilities.
Usage:
Add the following in `info.plist` file:
Privacy - Calendars Usage Description
Privacy - Reminders Usage Description
API list:
|
addPhoneRepeatCalendar | Adds a repeated event to the system calendar |
addPhoneCalendar | Adds an event to the system calendar |
TCMPPExtClipBoard
TCMPPExtClipBoard provides clipboard-related capabilities.
Usage:
API List:
|
setClipboardData | Sets the content of the system clipboard |
getClipboardData | Gets the content of the system clipboard |
TCMPPExtContact
TCMPPExtContact provides contact-related capabilities.
Usage:
Add the following in `info.plist` file: Privacy - Contacts Usage Description
API LIst:
|
chooseContact | Select a contact |
addPhoneContact | Add phone contacts |
TCMPPExtLBS
TCMPPExtLBS provides capabilities related to location services, maps, compass, accelerometer, device orientation, and gyroscope.
Usage:
Add the following in 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 | A series of APIs related to location |
System map | A series of APIs related to system maps |
Compass, accelerometer, device orientation, and gyroscope | A series of APIs related to these sensors |
TCMPPExtMDNS
TCMPPExtMDNS provides capabilities related to local network communication.
Usage:
Add the following in `info.plist` file:
Privacy - Local Network Usage Description
Privacy - Bonjour services
API List:
|
MDNS | A series of APIs related to MDNS |
TCMPPExtNetwork
TCMPPExtNetwork provides capabilities related to TCP/UDP communication.
Usage:
Add the following in info.plist file:
App Transport Security Settings
Allow Arbitrary Loads - YES
Privacy - Bonjour services
API List:
|
TCP | A series of APIs related to TCP |
UDP | A series of APIs related to UDP |
TCMPPExtMp3Encoder
TCMPPExtMp3Encoder provides the capability to save recordings as MP3 format when using RecorderManager.
Usage:
Usage:
The recording to MP3 format depends on the Lame library, which is open-source under the GNU Library or Lesser General Public License version 2.0 (LGPLv2) and GNU General Public License version 2.0 (GPLv2). For details, see LAME. You can integrate as needed.
Was this page helpful?