agora-appbuilder-core 4.1.8 → 4.1.9-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/android/app/build.gradle +7 -0
- package/template/bridge/rtm/web/Types.ts +183 -0
- package/template/bridge/rtm/web/index-legacy.ts +540 -0
- package/template/bridge/rtm/web/index.ts +423 -491
- package/template/defaultConfig.js +3 -3
- package/template/ios/Podfile +41 -0
- package/template/package.json +4 -4
- package/template/src/atoms/TextInput.tsx +3 -0
- package/template/src/components/RTMConfigure-legacy.tsx +848 -0
- package/template/src/components/RTMConfigure.tsx +644 -426
- package/template/src/rtm/RTMEngine.ts +130 -33
- package/template/src/rtm-events-api/Events.ts +106 -30
- package/template/src/subComponents/ChatInput.tsx +72 -1
- package/template/src/subComponents/caption/useSTTAPI.tsx +2 -2
- package/template/src/subComponents/caption/utils.ts +50 -14
- package/template/src/utils/useEndCall.ts +1 -1
- package/template/src/utils/useJoinRoom.ts +0 -1
package/package.json
CHANGED
|
@@ -101,6 +101,13 @@ android {
|
|
|
101
101
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
|
|
105
|
+
packagingOptions {
|
|
106
|
+
pickFirst '**/lib/arm64-v8a/libaosl.so'
|
|
107
|
+
pickFirst '**/lib/armeabi-v7a/libaosl.so'
|
|
108
|
+
pickFirst '**/lib/x86/libaosl.so'
|
|
109
|
+
pickFirst '**/lib/x86_64/libaosl.so'
|
|
110
|
+
}
|
|
104
111
|
}
|
|
105
112
|
|
|
106
113
|
dependencies {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {ChannelType as WebChannelType} from 'agora-rtm-sdk';
|
|
2
|
+
|
|
1
3
|
export interface AttributesMap {
|
|
2
4
|
[key: string]: string;
|
|
3
5
|
}
|
|
@@ -11,3 +13,184 @@ export interface ChannelAttributeOptions {
|
|
|
11
13
|
*/
|
|
12
14
|
enableNotificationToChannelMembers?: undefined | false | true;
|
|
13
15
|
}
|
|
16
|
+
|
|
17
|
+
// LINK STATE
|
|
18
|
+
export const nativeLinkStateMapping = {
|
|
19
|
+
IDLE: 0,
|
|
20
|
+
CONNECTING: 1,
|
|
21
|
+
CONNECTED: 2,
|
|
22
|
+
DISCONNECTED: 3,
|
|
23
|
+
SUSPENDED: 4,
|
|
24
|
+
FAILED: 5,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// Create reverse mapping: number -> string
|
|
28
|
+
export const webLinkStateMapping = Object.fromEntries(
|
|
29
|
+
Object.entries(nativeLinkStateMapping).map(([key, value]) => [value, key]),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export const linkStatusReasonCodeMapping: {[key: string]: number} = {
|
|
33
|
+
UNKNOWN: 0,
|
|
34
|
+
LOGIN: 1,
|
|
35
|
+
LOGIN_SUCCESS: 2,
|
|
36
|
+
LOGIN_TIMEOUT: 3,
|
|
37
|
+
LOGIN_NOT_AUTHORIZED: 4,
|
|
38
|
+
LOGIN_REJECTED: 5,
|
|
39
|
+
RELOGIN: 6,
|
|
40
|
+
LOGOUT: 7,
|
|
41
|
+
AUTO_RECONNECT: 8,
|
|
42
|
+
RECONNECT_TIMEOUT: 9,
|
|
43
|
+
RECONNECT_SUCCESS: 10,
|
|
44
|
+
JOIN: 11,
|
|
45
|
+
JOIN_SUCCESS: 12,
|
|
46
|
+
JOIN_FAILED: 13,
|
|
47
|
+
REJOIN: 14,
|
|
48
|
+
LEAVE: 15,
|
|
49
|
+
INVALID_TOKEN: 16,
|
|
50
|
+
TOKEN_EXPIRED: 17,
|
|
51
|
+
INCONSISTENT_APP_ID: 18,
|
|
52
|
+
INVALID_CHANNEL_NAME: 19,
|
|
53
|
+
INVALID_USER_ID: 20,
|
|
54
|
+
NOT_INITIALIZED: 21,
|
|
55
|
+
RTM_SERVICE_NOT_CONNECTED: 22,
|
|
56
|
+
CHANNEL_INSTANCE_EXCEED_LIMITATION: 23,
|
|
57
|
+
OPERATION_RATE_EXCEED_LIMITATION: 24,
|
|
58
|
+
CHANNEL_IN_ERROR_STATE: 25,
|
|
59
|
+
PRESENCE_NOT_CONNECTED: 26,
|
|
60
|
+
SAME_UID_LOGIN: 27,
|
|
61
|
+
KICKED_OUT_BY_SERVER: 28,
|
|
62
|
+
KEEP_ALIVE_TIMEOUT: 29,
|
|
63
|
+
CONNECTION_ERROR: 30,
|
|
64
|
+
PRESENCE_NOT_READY: 31,
|
|
65
|
+
NETWORK_CHANGE: 32,
|
|
66
|
+
SERVICE_NOT_SUPPORTED: 33,
|
|
67
|
+
STREAM_CHANNEL_NOT_AVAILABLE: 34,
|
|
68
|
+
STORAGE_NOT_AVAILABLE: 35,
|
|
69
|
+
LOCK_NOT_AVAILABLE: 36,
|
|
70
|
+
LOGIN_TOO_FREQUENT: 37,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// CHANNEL TYPE
|
|
74
|
+
// string -> number
|
|
75
|
+
export const nativeChannelTypeMapping = {
|
|
76
|
+
NONE: 0,
|
|
77
|
+
MESSAGE: 1,
|
|
78
|
+
STREAM: 2,
|
|
79
|
+
USER: 3,
|
|
80
|
+
};
|
|
81
|
+
// number -> string
|
|
82
|
+
export const webChannelTypeMapping = Object.fromEntries(
|
|
83
|
+
Object.entries(nativeChannelTypeMapping).map(([key, value]) => [value, key]),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// STORAGE TYPE
|
|
87
|
+
// string -> number
|
|
88
|
+
export const nativeStorageTypeMapping = {
|
|
89
|
+
NONE: 0,
|
|
90
|
+
/**
|
|
91
|
+
* 1: The user storage event.
|
|
92
|
+
*/
|
|
93
|
+
USER: 1,
|
|
94
|
+
/**
|
|
95
|
+
* 2: The channel storage event.
|
|
96
|
+
*/
|
|
97
|
+
CHANNEL: 2,
|
|
98
|
+
};
|
|
99
|
+
// number -> string
|
|
100
|
+
export const webStorageTypeMapping = Object.fromEntries(
|
|
101
|
+
Object.entries(nativeStorageTypeMapping).map(([key, value]) => [value, key]),
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// STORAGE EVENT TYPE
|
|
105
|
+
export const nativeStorageEventTypeMapping = {
|
|
106
|
+
/**
|
|
107
|
+
* 0: Unknown event type.
|
|
108
|
+
*/
|
|
109
|
+
NONE: 0,
|
|
110
|
+
/**
|
|
111
|
+
* 1: Triggered when user subscribe user metadata state or join channel with options.withMetadata = true
|
|
112
|
+
*/
|
|
113
|
+
SNAPSHOT: 1,
|
|
114
|
+
/**
|
|
115
|
+
* 2: Triggered when a remote user set metadata
|
|
116
|
+
*/
|
|
117
|
+
SET: 2,
|
|
118
|
+
/**
|
|
119
|
+
* 3: Triggered when a remote user update metadata
|
|
120
|
+
*/
|
|
121
|
+
UPDATE: 3,
|
|
122
|
+
/**
|
|
123
|
+
* 4: Triggered when a remote user remove metadata
|
|
124
|
+
*/
|
|
125
|
+
REMOVE: 4,
|
|
126
|
+
};
|
|
127
|
+
// number -> string
|
|
128
|
+
export const webStorageEventTypeMapping = Object.fromEntries(
|
|
129
|
+
Object.entries(nativeStorageEventTypeMapping).map(([key, value]) => [
|
|
130
|
+
value,
|
|
131
|
+
key,
|
|
132
|
+
]),
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
// PRESENCE EVENT TYPE
|
|
136
|
+
export const nativePresenceEventTypeMapping = {
|
|
137
|
+
/**
|
|
138
|
+
* 0: Unknown event type
|
|
139
|
+
*/
|
|
140
|
+
NONE: 0,
|
|
141
|
+
/**
|
|
142
|
+
* 1: The presence snapshot of this channel
|
|
143
|
+
*/
|
|
144
|
+
SNAPSHOT: 1,
|
|
145
|
+
/**
|
|
146
|
+
* 2: The presence event triggered in interval mode
|
|
147
|
+
*/
|
|
148
|
+
INTERVAL: 2,
|
|
149
|
+
/**
|
|
150
|
+
* 3: Triggered when remote user join channel
|
|
151
|
+
*/
|
|
152
|
+
REMOTE_JOIN: 3,
|
|
153
|
+
/**
|
|
154
|
+
* 4: Triggered when remote user leave channel
|
|
155
|
+
*/
|
|
156
|
+
REMOTE_LEAVE: 4,
|
|
157
|
+
/**
|
|
158
|
+
* 5: Triggered when remote user's connection timeout
|
|
159
|
+
*/
|
|
160
|
+
REMOTE_TIMEOUT: 5,
|
|
161
|
+
/**
|
|
162
|
+
* 6: Triggered when user changed state
|
|
163
|
+
*/
|
|
164
|
+
REMOTE_STATE_CHANGED: 6,
|
|
165
|
+
/**
|
|
166
|
+
* 7: Triggered when user joined channel without presence service
|
|
167
|
+
*/
|
|
168
|
+
ERROR_OUT_OF_SERVICE: 7,
|
|
169
|
+
};
|
|
170
|
+
// number -> string
|
|
171
|
+
export const webPresenceEventTypeMapping = Object.fromEntries(
|
|
172
|
+
Object.entries(nativePresenceEventTypeMapping).map(([key, value]) => [
|
|
173
|
+
value,
|
|
174
|
+
key,
|
|
175
|
+
]),
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
// MESSAGE EVENT TYPE
|
|
179
|
+
// string -> number
|
|
180
|
+
export const nativeMessageEventTypeMapping = {
|
|
181
|
+
/**
|
|
182
|
+
* 0: The binary message.
|
|
183
|
+
*/
|
|
184
|
+
BINARY: 0,
|
|
185
|
+
/**
|
|
186
|
+
* 1: The ascii message.
|
|
187
|
+
*/
|
|
188
|
+
STRING: 1,
|
|
189
|
+
};
|
|
190
|
+
// number -> string
|
|
191
|
+
export const webMessageEventTypeMapping = Object.fromEntries(
|
|
192
|
+
Object.entries(nativePresenceEventTypeMapping).map(([key, value]) => [
|
|
193
|
+
value,
|
|
194
|
+
key,
|
|
195
|
+
]),
|
|
196
|
+
);
|