Files
jitsi-meet/react/features/app/functions.native.ts
Hristo Terezov 6742435487 fix: GUM prompt not displayed after deeplinking page.
When we open a custom scheme URL before the window load event has been fired it seems that GUM prompt is not displayed after this due to Chrome bug. See more details here https://issues.chromium.org/issues/41398687.

The result in Jitsi Meet is the following:
If the user is joining a call for first time and haven't granted A/V permissions and lands on the deeplinking page we try to open the desktop app via redirect to a custom scheme URL. If the user chooses cancel and "Launch in web" we go to the prejoin screen and proceed with the initial GUM. At this point any GUM call won't display the permission prompt due to the browser bug and will go on forever making it impossible for the user to unmute camera or microphone.
2025-07-11 16:47:50 -05:00

57 lines
1.4 KiB
TypeScript

import { NativeModules } from 'react-native';
import { IStateful } from '../base/app/types';
import { toState } from '../base/redux/functions';
import { getServerURL } from '../base/settings/functions.native';
export * from './functions.any';
import logger from './logger';
/**
* 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: IStateful) {
const state = toState(stateful);
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;
}
/**
* This is a dummy implementation for compatibility with web. It executes the passed handler right away.
*
* @param {Function} handler - The callback function to execute.
* @returns {void}
*/
export function executeAfterLoad(handler: () => void) {
try {
handler();
} catch (error) {
logger.error('Error executing handler after load:', error);
}
}