-
Notifications
You must be signed in to change notification settings - Fork 76
/
Code.txt
99 lines (76 loc) · 2.4 KB
/
Code.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
react-native init RNVideoVoiceCall
cd RNVideoVoiceCall
npm install
Package:
https://reactnavigation.org/docs/intro/
https://github.com/voximplant/react-native-voximplant
https://github.com/joinspontaneous/react-native-loading-spinner-overlay
npm install --save react-navigation
npm install --save react-native-loading-spinner-overlay@latest
npm install react-native-voximplant@latest --save
react-native link
Usage Stack Navigator:
import { StackNavigator } from "react-navigation";
and
return (
<View>
<Boiler navigation={this.props.navigation} />
</View>
);
and
const app = StackNavigator({
Boiler: {
screen: HomeScreen,
navigationOptions: {
title: "Boiler"
}
}
});
Usage spinner:
import Spinner from "react-native-loading-spinner-overlay";
this.state = {
loading: false
};
<Spinner visible={this.state.loading} />
when need to show spinner: this.setState({ loading: true });
when need to hide spinner: this.setState({ loading: false });
Usage voximplant:
react-native link react-native-voximplant
In android/src/main/AndroidManifest.xml add user permissions:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
DeviceEventEmitter.addListener("ConnectionSuccessful", () => {
console.log("Connection successful");
});
DeviceEventEmitter.addListener("LoginSuccessful", () => {
console.log("Login successful ");
});
DeviceEventEmitter.addListener("LoginFailed", () => {
console.log("Login failed");
});
componentDidMount() {
VoxImplant.SDK.connect();
}
const responseM = await fetch(
"https://api.voximplant.com/platform_api/Logon/?account_email=" +
Vemail +
"&account_password=" +
Vpassword
);
const jsonM = await responseM.json();
const api_key = jsonM.api_key;
const account_id = JSON.stringify(jsonM.account_id);
await AsyncStorage.setItem("API", api_key);
await AsyncStorage.setItem("ACC_ID", account_id);
VoxImplant.SDK.login(
usernameValue +
"@" +
appnameValue +
"." +
accnameValue +
".voximplant.com",
passwordValue
);