jiti-meet/react/features/app/functions.native.js

40 lines
942 B
JavaScript
Raw Normal View History

// @flow
import { NativeModules } from 'react-native';
import { toState } from '../base/redux';
import { getServerURL } from '../base/settings';
/**
* 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.
*/
export function getDefaultURL(stateful: Function | Object) {
const state = toState(stateful);
2019-03-05 10:58:53 +00:00
return getServerURL(state);
}
/**
* Returns application name.
*
* @returns {string} The application name.
*/
export function getName() {
return NativeModules.AppInfo.name;
}
/**
* 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;
}