2017-10-13 20:34:27 +00:00
|
|
|
import { NativeModules } from 'react-native';
|
2017-08-22 17:28:31 +00:00
|
|
|
|
2022-10-21 11:09:15 +00:00
|
|
|
import { IStateful } from '../base/app/types';
|
|
|
|
import { toState } from '../base/redux/functions';
|
|
|
|
import { getServerURL } from '../base/settings/functions';
|
2019-02-07 14:37:35 +00:00
|
|
|
|
2022-03-17 14:13:58 +00:00
|
|
|
export * from './functions.any';
|
|
|
|
|
2019-02-07 14:37:35 +00:00
|
|
|
/**
|
|
|
|
* Retrieves the default URL for the app. This can either come from a prop to
|
|
|
|
* the root App component or be configured in the settings.
|
|
|
|
*
|
|
|
|
* @param {Function|Object} stateful - The redux store or {@code getState}
|
|
|
|
* function.
|
|
|
|
* @returns {string} - Default URL for the app.
|
|
|
|
*/
|
2022-10-21 11:09:15 +00:00
|
|
|
export function getDefaultURL(stateful: IStateful) {
|
2019-02-07 14:37:35 +00:00
|
|
|
const state = toState(stateful);
|
|
|
|
|
2019-03-05 10:58:53 +00:00
|
|
|
return getServerURL(state);
|
2019-02-07 14:37:35 +00:00
|
|
|
}
|
2016-10-05 14:36:59 +00:00
|
|
|
|
|
|
|
/**
|
2017-10-13 20:34:27 +00:00
|
|
|
* Returns application name.
|
2016-10-05 14:36:59 +00:00
|
|
|
*
|
2017-10-13 20:34:27 +00:00
|
|
|
* @returns {string} The application name.
|
2016-10-05 14:36:59 +00:00
|
|
|
*/
|
2017-10-13 20:34:27 +00:00
|
|
|
export function getName() {
|
|
|
|
return NativeModules.AppInfo.name;
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
2018-04-05 19:12:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the path to the Jitsi Meet SDK bundle on iOS. On Android it will be
|
|
|
|
* undefined.
|
|
|
|
*
|
|
|
|
* @returns {string|undefined}
|
|
|
|
*/
|
|
|
|
export function getSdkBundlePath() {
|
|
|
|
return NativeModules.AppInfo.sdkBundlePath;
|
|
|
|
}
|