Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

functions.native.ts 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { NativeModules } from 'react-native';
  2. import { IReduxState } from '../../app/types';
  3. import { REPLACE_PARTICIPANT } from '../flags/constants';
  4. import { getFeatureFlag } from '../flags/functions';
  5. import { IConfig, IDeeplinkingConfig } from './configType';
  6. export * from './functions.any';
  7. /**
  8. * Removes all analytics related options from the given configuration, in case of a libre build.
  9. *
  10. * @param {*} config - The configuration which needs to be cleaned up.
  11. * @returns {void}
  12. */
  13. export function _cleanupConfig(config: IConfig) {
  14. config.analytics = config.analytics ?? {};
  15. config.analytics.scriptURLs = [];
  16. if (NativeModules.AppInfo.LIBRE_BUILD) {
  17. delete config.analytics?.amplitudeAPPKey;
  18. delete config.analytics?.googleAnalyticsTrackingId;
  19. delete config.analytics?.rtcstatsEnabled;
  20. delete config.analytics?.rtcstatsEndpoint;
  21. delete config.analytics?.rtcstatsPollInterval;
  22. delete config.analytics?.rtcstatsSendSdp;
  23. delete config.analytics?.rtcstatsUseLegacy;
  24. delete config.analytics?.obfuscateRoomName;
  25. delete config.analytics?.watchRTCEnabled;
  26. delete config.watchRTCConfigParams;
  27. config.giphy = { enabled: false };
  28. }
  29. }
  30. /**
  31. * Returns the replaceParticipant config.
  32. *
  33. * @param {Object} state - The state of the app.
  34. * @returns {boolean}
  35. */
  36. export function getReplaceParticipant(state: IReduxState): string {
  37. return getFeatureFlag(state, REPLACE_PARTICIPANT, false);
  38. }
  39. /**
  40. * Sets the defaults for deeplinking.
  41. *
  42. * @param {IDeeplinkingConfig} _deeplinking - The deeplinking config.
  43. * @returns {void}
  44. */
  45. export function _setDeeplinkingDefaults(_deeplinking: IDeeplinkingConfig) {
  46. return;
  47. }