Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(deep-linking): use same action for join in app if scheme url is undefined
Calin-Teodor16fcf27fb702
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xmlindex 04114e6fc9..5a0dedc2dd 100644--- a/android/app/src/main/AndroidManifest.xml+++ b/android/app/src/main/AndroidManifest.xml@@ -26,7 +26,7 @@<action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter>- <intent-filter>+ <intent-filter android:autoVerify="true"><action android:name="android.intent.action.VIEW" /><category android:name="android.intent.category.BROWSABLE" /><category android:name="android.intent.category.DEFAULT" />diff --git a/react/features/base/config/functions.web.ts b/react/features/base/config/functions.web.tsindex 86fb4a5f2c..cb530a659f 100644--- a/react/features/base/config/functions.web.ts+++ b/react/features/base/config/functions.web.ts@@ -74,12 +74,12 @@ export function _setDeeplinkingDefaults(deeplinking: IDeeplinkingConfig) {|| 'https://github.com/jitsi/jitsi-meet-electron/releases/latest/download/jitsi-meet-x86_64.AppImage';ios.appName = ios.appName || 'Jitsi Meet';- ios.appScheme = ios.appScheme || 'org.jitsi.meet';+ ios.appScheme = ios.appScheme ?? 'org.jitsi.meet';ios.downloadLink = ios.downloadLink|| 'https://itunes.apple.com/us/app/jitsi-meet/id1165103905';android.appName = android.appName || 'Jitsi Meet';- android.appScheme = android.appScheme || 'org.jitsi.meet';+ android.appScheme = android.appScheme ?? 'org.jitsi.meet';android.downloadLink = android.downloadLink|| 'https://play.google.com/store/apps/details?id=org.jitsi.meet';android.appPackage = android.appPackage || 'org.jitsi.meet';diff --git a/react/features/deep-linking/components/DeepLinkingMobilePage.web.tsx b/react/features/deep-linking/components/DeepLinkingMobilePage.web.tsxindex 12caf93339..bd6ef767db 100644--- a/react/features/deep-linking/components/DeepLinkingMobilePage.web.tsx+++ b/react/features/deep-linking/components/DeepLinkingMobilePage.web.tsx@@ -95,13 +95,13 @@ const useStyles = makeStyles()((theme: Theme) => {});const DeepLinkingMobilePage: React.FC<WithTranslation> = ({ t }) => {+ const dispatch = useDispatch();const deeplinkingCfg = useSelector((state: IReduxState) =>state['features/base/config']?.deeplinking || {} as IDeeplinkingConfig);const { hideLogo } = deeplinkingCfg;- const deepLinkingUrl: string = useSelector(generateDeepLinkingURL);+ const deepLinkingUrl: string | undefined = useSelector(generateDeepLinkingURL);const room = useSelector((state: IReduxState) => decodeURIComponent(state['features/base/conference'].room || ''));const url = useSelector((state: IReduxState) => state['features/base/connection'] || {});- const dispatch = useDispatch();const { classes: styles } = useStyles();const generateDownloadURL = useCallback(() => {@@ -128,7 +128,10 @@ const DeepLinkingMobilePage: React.FC<WithTranslation> = ({ t }) => {sendAnalytics(createDeepLinkingPageEvent('clicked', 'openAppButton', { isMobileBrowser: true }));- }, []);+ if (!deepLinkingUrl) {+ dispatch(openWebApp());+ }+ }, [ deepLinkingUrl ]);const onOpenLinkProperties = useMemo(() => {const { downloadLink }diff --git a/react/features/deep-linking/functions.web.ts b/react/features/deep-linking/functions.web.tsindex 314677efaf..dc3df40b94 100644--- a/react/features/deep-linking/functions.web.ts+++ b/react/features/deep-linking/functions.web.ts@@ -13,17 +13,11 @@ import { _openDesktopApp } from './openDesktopApp.web';/*** Generates a deep linking URL based on the current window URL.*- * @param {Object} state - Object containing current redux state.+ * @param {IReduxState} state - The current state of the app.*- * @returns {string} - The generated URL.+ * @returns {string|undefined} - The generated URL, or undefined if no scheme is configured.*/-export function generateDeepLinkingURL(state: IReduxState) {- // If the user installed the app while this Component was displayed- // (e.g. the user clicked the Download the App button), then we would- // like to open the current URL in the mobile app. The only way to do it- // appears to be a link with an app-specific scheme, not a Universal- // Link.-+export function generateDeepLinkingURL(state: IReduxState): string | undefined {const { href } = window.location;const regex = new RegExp(URI_PROTOCOL_PATTERN, 'gi');@@ -32,6 +26,10 @@ export function generateDeepLinkingURL(state: IReduxState) {const { appScheme, appPackage } = mobileConfig;+ if (!appScheme) {+ return undefined;+ }+// Android: use an intent link, custom schemes don't work in all browsers.// https://developer.chrome.com/multidevice/android/intentsif (Platform.OS === 'android') {