Skip to content

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, PhizClip 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

objectivec
// Register the extension SDK
[[FATExtClient sharedClient] fat_prepareExtensionApis];

1.2 Included applet APIs

api Nameapi description information
chooseLocationSelect the location.
getLocationGet location information.
openLocationUse the map to view the location
choosePoiOpen POI list to select a location
startRecordStart recording.
stopRecordStop recording.
RecorderManagerRecording 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

objectivec
// WebRTC initialization
[FATWebRTCComponent registerComponent]

2.2 Included applet APIs

api Nameapi description information
webrtc-video componentcomponent 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

objectivec
// Baidu map extension SDK initialization
[FATBDMapComponent setBDMapAppKey:@"Applied key"]

3.2 Included applet APIs

api Nameapi description information
Map componentView Components
MapContextA 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

objectivec
// Initialization of Gaode Map Extension SDK
[FATGDMapComponent setGDMapAppKey:@"Applied key"]

4.2 Included applet APIs

api Nameapi description information
Map componentView Components
MapContextA series of api

5 Bluetooth Extension SDK

The FinAppletBLE contains a series of Bluetooth-related api.

5.1 Included applet APIs

api Nameapi description information
Bluetooth - UniversalA series of api
Bluetooth - Low Power Center DeviceA series of api
Bluetooth - Low Power PeripheralsA series of api
Bluetooth-BeaconsA series of api

6 Address Book Extension SDK

FinAppletContact is an address book extension SDK.

6.1 Register the extension SDK

objectivec
// ContactSDK initialization
[FATContactComponent registerComponent]

6.2 Included applet APIs

api Nameapi description information
addPhoneContactAdd 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

objectivec
// ClipBoard initialization
[FATClipBoardComponent registerComponent];

7.2 Included applet APIs

api Nameapi description information
setClipboardDataAdd clipboard content.
getClipboardDataReads 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:

objectivec
// 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

objectivec
// AgoraRTC initialization
[FATAgoraRTCComponent registerComponent]

8.2 Included applet APIs

api Nameapi description information
initInitializing the SoundNet SDK
setRoleSetting up client roles
joinJoin the channel
publishStart pushing the flow
muteLocalLocal Mute
unmuteLocalUnmute local mute
muteRemote mute
unmuteUnmute the remote end
renewTokenRefresh token
setRemoteVideoStreamTypeSet the type of video stream to subscribe to
destroyStop pushing streams and free up resources
live-pusherlive-pusher component
live-playerlive-player component

9 Phiz Extension SDK

FinAppletWXExt, some APIs related to Phiz, need to rely on the Phiz Open SDK to implement, we have also done the package.

9.1 Register for the Phiz Extension SDK

objectivec
// Phiz extension SDL initialization
[FATWXExtComponent registerComponent:@"Phizclip appid" universalLink:@"universalLink"];

9.2 Included APIs

api Nameapi description information
loginCall up the Phiz applet, get the login credentials, and return the results to the PhizClip applet
getUserProfileCall up the Phiz applet, get user information and return the results to the PhizClip applet
requestPaymentInvoke the Phiz applet, initiate a Phiz payment, and return the result to the PhizClip applet
getPhoneNumberCall up the Phiz applet, get the dynamic token, and return the result to the PhizClip applet