cmos-ytx-rnp
v1.0.4
Published
ytx sdk by rn
Downloads
10
Readme
一、安装
1、npm i cmos-ytx-rnp
2、setting.gradle添加:
include ':lib', ':libytx'
project(':libytx').projectDir = new File(rootProject.projectDir, '../node_modules/cmos-ytx-rnp')
3、app-->build.gradle中添加:
repositories {
flatDir {
dirs 'libs', '../../node_modules/cmos-ytx-rnp/libs'
}
}
compile project(':libytx')
4、build
安装完毕
二、使用
1、导入模块:
js中:
import Voip from "cmos-ytx-rnp"
MainApplication:
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
...,
new VoipReactPackage()
);
}
2、初始化Voip: example:
let param = {
"appKey": yourAppKey
"token": yourToken
};
let str = JSON.stringify(param);
Voip.init(str);
3、登陆: example:
Voip.logout((msg) => {
Alert.alert(msg);
}, (error) => {
Alert.alert(error);
})
4、登出: example:
Voip.logout((msg) => {
Alert.alert(msg);
}, (error) => {
Alert.alert(error);
})
5、呼出音频:
Voip.makeVoiceCall(num);
6、呼出视频:
Voip.makeVideoCall(num);