You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.native.js 1019B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import { NativeModules } from 'react-native';
  3. import { getAppProp } from '../base/app';
  4. import { toState } from '../base/redux';
  5. import { getServerURL } from '../base/settings';
  6. /**
  7. * Retrieves the default URL for the app. This can either come from a prop to
  8. * the root App component or be configured in the settings.
  9. *
  10. * @param {Function|Object} stateful - The redux store or {@code getState}
  11. * function.
  12. * @returns {string} - Default URL for the app.
  13. */
  14. export function getDefaultURL(stateful: Function | Object) {
  15. const state = toState(stateful);
  16. return getAppProp(state, 'defaultURL') || getServerURL(state);
  17. }
  18. /**
  19. * Returns application name.
  20. *
  21. * @returns {string} The application name.
  22. */
  23. export function getName() {
  24. return NativeModules.AppInfo.name;
  25. }
  26. /**
  27. * Returns the path to the Jitsi Meet SDK bundle on iOS. On Android it will be
  28. * undefined.
  29. *
  30. * @returns {string|undefined}
  31. */
  32. export function getSdkBundlePath() {
  33. return NativeModules.AppInfo.sdkBundlePath;
  34. }