Instructions of private deployment server
Note:The initialization process for this page only applies to private deployment services.
Private service means that the user can use the free server program released by starRTC and run the program on the user’s own server. All data does not store on the starRTC, and we do not bear the risk of illegal data.
The private service SDK does not need to log in. So the sdk of the starRTC does not verify the validity of the user and the users maintain the validity by themselves. The setting of the login service URL is omitted when initialization.
In addition, the SDK can directly set the service address of each function service through the API. The original scheduling link is eliminated. So it is access to small and medium-sized projects more flexibly.
Usage method:
1 Initialization:
The initialization steps are very similar to the normal version, which is calling a few different API functions.XHCustomConfig customConfig = XHCustomConfig.getInstance(context);
customConfig.setChatroomServerUrl(MLOC.CHAT_ROOM_SERVER_URL);
customConfig.setLiveSrcServerUrl(MLOC.LIVE_SRC_SERVER_URL);
customConfig.setLiveVdnServerUrl(MLOC.LIVE_VDN_SERVER_URL);
customConfig.setImServereUrl(MLOC.IM_SERVER_URL);
customConfig.setVoipServerUrl(MLOC.VOIP_SERVER_URL);
customConfig.initSDKForFree(MLOC.userId, new IXHErrorCallback() {
public void error(final String errMsg, Object data) {
}
},new Handler());
2 New API for IM group
The user’s own group list and group information (group member list and DND status) can be directly obtained from the SDK’s API.
Note: The two APIs below are only used when the private deployment service is available.XHClient.getInstance().getGroupManager().queryGroupList(new IXHResultCallback() {
public void success(final Object data) {
//Get the group list successfully
}
public void failed(String errMsg) {
//Failed to get group list
}
});
XHClient.getInstance().getGroupManager().queryGroupInfo(mGroupId, new IXHResultCallback() {
public void success(final Object data) {
//Get group information successfully
}
public void failed(String errMsg) {
//Failed to get group information
}
});