react-native-sip-android
v1.0.2
Published
RN 云信通达 SIP 直呼手机 android 端封装
Downloads
1
Readme
react-native-sip-android
RN 云信通达 SIP 直呼手机 android 端封装
安装
npm install react-native-sip-android
使用
Android 配置
在 AndroidManifest.xml
中添加广播接收器
<receiver android:name="com.yzxtcp.tools.tcp.receiver.AlarmReceiver"></receiver>
<receiver android:name="com.yzxtcp.tools.tcp.receiver.MsgBackReceiver"></receiver>
<receiver android:name="com.yzx.tools.RtppReceiver" />
使用示例
import Sip from 'react-native-sip-android';
// 初始化
useEffect(() => {
Sip.sharedInstance.addEventListener((e) => {
console.log('收到事件', e);
});
Sip.sharedInstance.init('token');
return () => {
Sip.sharedInstance.destroy();
};
}, []);
// 呼叫
Sip.sharedInstance.call('16602152874');
// 挂断
Sip.sharedInstance.hangup();