diff --git a/app/lib/methods/helpers/openLink.ts b/app/lib/methods/helpers/openLink.ts index 45e3df5d6..e4ade0a30 100644 --- a/app/lib/methods/helpers/openLink.ts +++ b/app/lib/methods/helpers/openLink.ts @@ -6,6 +6,7 @@ import { themes } from '../../constants'; import { TSupportedThemes } from '../../../theme'; import UserPreferences from '../userPreferences'; import ensureSecureProtocol from './ensureSecureProtocol'; +import log from './log'; export const DEFAULT_BROWSER_KEY = 'DEFAULT_BROWSER_KEY'; @@ -38,6 +39,16 @@ const appSchemeURL = (url: string, browser: string): string => { }; const openLink = async (url: string, theme: TSupportedThemes = 'light'): Promise => { + const telRegExp = new RegExp(/^(tel:)/); + if (telRegExp.test(url)) { + try { + await Linking.openURL(url); + return; + } catch (e) { + log(e); + } + } + url = ensureSecureProtocol(url); try { const browser = UserPreferences.getString(DEFAULT_BROWSER_KEY); diff --git a/ios/RocketChatRN/Info.plist b/ios/RocketChatRN/Info.plist index bc380c71b..d3080d8ab 100644 --- a/ios/RocketChatRN/Info.plist +++ b/ios/RocketChatRN/Info.plist @@ -54,6 +54,7 @@ googlechromes firefox brave + tel LSRequiresIPhoneOS