agora-appbuilder-core 4.0.33 → 4.0.34

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.0.33",
3
+ "version": "4.0.34",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -76,8 +76,8 @@ const DefaultConfig = {
76
76
  CHAT_ORG_NAME: '',
77
77
  CHAT_APP_NAME: '',
78
78
  CHAT_URL: '',
79
- CLI_VERSION: '3.0.33',
80
- CORE_VERSION: '4.0.33',
79
+ CLI_VERSION: '3.0.34',
80
+ CORE_VERSION: '4.0.34',
81
81
  DISABLE_LANDSCAPE_MODE: false,
82
82
  STT_AUTO_START: false,
83
83
  CLOUD_RECORDING_AUTO_START: false,
@@ -232,27 +232,55 @@ const AuthProvider = (props: AuthProviderProps) => {
232
232
  regEvent.current = false;
233
233
  SDKMethodEventsManager.on('login', async (res, rej, token) => {
234
234
  try {
235
+ logger.log(LogSource.Internals, 'AUTH', 'SDK login method called');
235
236
  setStore(prevState => {
236
237
  return {...prevState, token};
237
238
  });
238
239
  setTimeout(async () => {
239
240
  enableTokenAuth(token)
240
241
  .then(() => {
242
+ logger.log(LogSource.Internals, 'AUTH', 'SDK login success');
243
+ setIsAuthenticated(true);
244
+ setLoading(false);
241
245
  res();
242
246
  })
243
247
  .catch(error => {
248
+ logger.error(
249
+ LogSource.Internals,
250
+ 'AUTH',
251
+ 'SDK login failed',
252
+ error,
253
+ );
254
+ Toast.show({
255
+ leadingIconName: 'alert',
256
+ type: 'error',
257
+ text1: 'Authentication failed',
258
+ text2: 'Please try again later.',
259
+ visibilityTime: 1000 * 60,
260
+ });
244
261
  rej('SDK Login failed' + JSON.stringify(error));
245
262
  });
246
263
  });
247
264
  } catch (error) {
265
+ logger.error(LogSource.Internals, 'AUTH', 'SDK login failed', error);
266
+ Toast.show({
267
+ leadingIconName: 'alert',
268
+ type: 'error',
269
+ text1: 'Authentication failed',
270
+ text2: 'Please try again later.',
271
+ visibilityTime: 1000 * 60,
272
+ });
248
273
  rej('SDK Login failed' + JSON.stringify(error));
249
274
  }
250
275
  });
251
276
  SDKMethodEventsManager.on('logout', async (res, rej) => {
252
277
  try {
278
+ logger.log(LogSource.Internals, 'AUTH', 'SDK logout called');
253
279
  await tokenLogout();
280
+ logger.log(LogSource.Internals, 'AUTH', 'SDK logout success');
254
281
  res();
255
282
  } catch (error) {
283
+ logger.error(LogSource.Internals, 'AUTH', 'SDK logout failed', error);
256
284
  rej('SDK Logout failed' + JSON.stringify(error));
257
285
  }
258
286
  });
@@ -366,8 +394,10 @@ const AuthProvider = (props: AuthProviderProps) => {
366
394
  return;
367
395
  }
368
396
  if (isSDK() && ENABLE_AUTH) {
369
- setIsAuthenticated(true);
370
- setLoading(false);
397
+ // Auth error fix - updating state on login event callback
398
+ // if no login event is called then appliation only show loading label
399
+ // setIsAuthenticated(true);
400
+ // setLoading(false);
371
401
  return () => {};
372
402
  }
373
403
  //if application in authorization state then don't call authlogin