Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

functions.native.ts 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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.callStatsID;
  27. delete config.callStatsSecret;
  28. delete config.watchRTCConfigParams;
  29. config.giphy = { enabled: false };
  30. }
  31. }
  32. /**
  33. * Returns the replaceParticipant config.
  34. *
  35. * @param {Object} state - The state of the app.
  36. * @returns {boolean}
  37. */
  38. export function getReplaceParticipant(state: IReduxState): string {
  39. return getFeatureFlag(state, REPLACE_PARTICIPANT, false);
  40. }
  41. /**
  42. * Sets the defaults for deeplinking.
  43. *
  44. * @param {IDeeplinkingConfig} _deeplinking - The deeplinking config.
  45. * @returns {void}
  46. */
  47. export function _setDeeplinkingDefaults(_deeplinking: IDeeplinkingConfig) {
  48. return;
  49. }