Appearance
Extended SDK
The extension SDK complements the core SDK, so to use the extension SDK, you must also rely on the core SDK.
In order to ensure the security and stability of the SDK, the APIs that require permissions are put into the extension SDK as much as possible, FinClip splits the SDK into a core SDK and an extension SDK, the latter is the complement of the former, so the use of the extension SDK must also rely on the core SDK.
For some api's that involve permissions, we split them into extension SDKs, and you can integrate the corresponding extension SDKs according to the actual situation.
Get the extension SDK
You can download the iOS SDK file at the Resource Download Center. The extended SDK is also included in the downloaded zip file.
1 Extended SDK
FinAppletExt
is the first extension SDK that we split out.
1.1 Register the extension SDK
objective-c
// Register the extension SDK
[[FATExtClient sharedClient] fat_prepareExtensionApis];
1.2 Included mini progmini APIs
api Name | api description information |
---|---|
chooseLocation | Select the location. |
getLocation | Get location information. |
openLocation | Use the map to view the location |
choosePoi | Open POI list to select a location |
startRecord | Start recording. |
stopRecord | Stop recording. |
RecorderManager | Recording manager and some api |
2 WebRTC Extensions SDK
FinAppletWebRTC
contains webRTC components that we have wrapped based on google's WebRTC library.
2.1 Register the extension SDK
objective-c
// WebRTC initialization
[FATWebRTCComponent registerComponent]
2.2 Included mini progmini APIs
api Name | api description information |
---|---|
webrtc-video component | component and a series of api for webrtc |
3 Baidu Map Extension SDK
FinAppletBDMap
contains the map-view component that we implemented based on the Baidu Map SDK.
Node 1. If Baidu Map is integrated and set to use Baidu Map, then the Map component and Map's api will use Baidu Map. 2. If Gaode Map is integrated and set to use Gaode Map, then the Map component and Map's api will use Gaode Map. 3. If neither Baidu Map nor Gaode Map is integrated and not set, then the Map component and Map's api will use the system's own map.
So, for the Map component and related api, you only need to choose one of the above three options.
3.1 Register the extension SDK
objective-c
// Baidu map extension SDK initialization
[FATBDMapComponent setBDMapAppKey:@"Applied key"]
3.2 Included mini progmini APIs
api Name | api description information |
---|---|
Map component | View Components |
MapContext | A series of api |
4 Gaode Map Extension SDK
FinAppletGDMap
contains the map-view component that we have wrapped based on the Gaode Map SDK.
Node 1. If Baidu Map is integrated and set to use Baidu Map, then the Map component and Map's api will use Baidu Map. 2. If Gaode Map is integrated and set to use Gaode Map, then the Map component and Map's api will use Gaode Map. 3. If neither Baidu Map nor Gaode Map is integrated and not set, then the Map component and Map's api will use the system's own map.
So, for the Map component and related api, you only need to choose one of the above three options.
4.1 Register the extension SDK
objective-c
// Initialization of Gaode Map Extension SDK
[FATGDMapComponent setGDMapAppKey:@"Applied key"]
4.2 Included mini progmini APIs
api Name | api description information |
---|---|
Map component | View Components |
MapContext | A series of api |
5 Bluetooth Extension SDK
The FinAppletBLE
contains a series of Bluetooth-related api.
5.1 Included mini progmini APIs
api Name | api description information |
---|---|
Bluetooth - Universal | A series of api |
Bluetooth - Low Power Center Device | A series of api |
Bluetooth - Low Power Peripherals | A series of api |
Bluetooth-Beacons | A series of api |
6 Address Book Extension SDK
FinAppletContact
is an address book extension SDK.
6.1 Register the extension SDK
objective-c
// ContactSDK initialization
[FATContactComponent registerComponent]
6.2 Included mini progmini APIs
api Name | api description information |
---|---|
addPhoneContact | Add contacts to your phone's address book. |
7 Pasteboard extension SDK
FinAppletClipBoard
, since the pasteboard function is also sensitive, we wrap the two api related to the pasteboard in this extension SDK.
7.1 Register the extension SDK
objective-c
// ClipBoard initialization
[FATClipBoardComponent registerComponent];
7.2 Included mini progmini APIs
api Name | api description information |
---|---|
setClipboardData | Add clipboard content. |
getClipboardData | Reads the clipboard contents. |
Node
Since the clipboard permissions are sensitive and the api is relatively cold. You can also add two api related to the clipboard by registering a custom api.
The injected source code is as follows:
objective-c
// Register setClipboardData
[[FATClient sharedClient] registerExtensionApi:@"setClipboardData" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) {
NSString *data = param[@"data"];
if (!data) {
callback(FATExtensionCodeFailure, @{@"errMsg" : @"The parameter data is empty"});
return;
}
[UIPasteboard generalPasteboard].string = data;
NSDictionary *result = @{@"data" : data};
callback(FATExtensionCodeSuccess, result);
}];
// Register getClipboardData
[[FATClient sharedClient] registerExtensionApi:@"getClipboardData" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) {
NSString *data = [UIPasteboard generalPasteboard].string;
NSDictionary *result = @{@"data" : data == nil ? @"" : data};
callback(FATExtensionCodeSuccess, result);
}];
8 SoundNet Extension SDK
FinAppletAgoraRTC
, currently live-player, live-pusher components can be implemented using the SoundNet Extension SDK.
Node
The corresponding protocol methods of live-player and live-pusher components are encapsulated in FATAppletNativeViewProtocol
. The SoundNet Extension SDK is our implementation of the live-player and live-pusher protocol methods using the SoundNet SDK, so when you use live-player and live-pusher, you can either implement the protocol methods by App or integrate the SoundNet Extension SDK directly.
8.1 Register the extension SDK
objective-c
// AgoraRTC initialization
[FATAgoraRTCComponent registerComponent]
8.2 Included mini progmini APIs
api Name | api description information |
---|---|
init | Initializing the SoundNet SDK |
setRole | Setting up client roles |
join | Join the channel |
publish | Start pushing the flow |
muteLocal | Local Mute |
unmuteLocal | Unmute local mute |
mute | Remote mute |
unmute | Unmute the remote end |
renewToken | Refresh token |
setRemoteVideoStreamType | Set the type of video stream to subscribe to |
destroy | Stop pushing streams and free up resources |
live-pusher | live-pusher component |
live-player | live-player component |
9 WeChat Extension SDK
FinAppletWXExt
, some APIs related to WeChat, need to rely on the WeChat Open SDK to implement, we have also done the package.
9.1 Register for the WeChat Extension SDK
objective-c
// WeChat extension SDL initialization
[FATWXExtComponent registerComponent:@"微信appid" universalLink:@"universalLink"];
9.2 Included APIs
api Name | api description information |
---|---|
login | Call up the WeChat mini progmini, get the login credentials, and return the results to the FinClip mini progmini |
getUserProfile | Call up the WeChat mini progmini, get user information and return the results to the FinClip mini progmini |
requestPayment | Invoke the WeChat mini progmini, initiate a WeChat payment, and return the result to the FinClip mini progmini |
getPhoneNumber | Call up the WeChat mini progmini, get the dynamic token, and return the result to the FinClip mini progmini |