Improve URL decoding and bump version for publication

pull/53/merge
Tiago Daniel Jacobs 2 years ago
parent 6f9b779248
commit b8f9704cff

@ -597,7 +597,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "BigBlueButton Tablet.entitlements";
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = N69T9W23TC;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = BigBlueButtonTablet/Info.plist;
@ -635,7 +635,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "BigBlueButton Tablet.entitlements";
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = N69T9W23TC;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = BigBlueButtonTablet/Info.plist;
@ -676,7 +676,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "BigBlueButton Broadcast/BigBlueButton Broadcast.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = N69T9W23TC;
ENABLE_BITCODE = NO;
@ -718,7 +718,7 @@
CODE_SIGN_ENTITLEMENTS = "BigBlueButton Broadcast/BigBlueButton Broadcast.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = N69T9W23TC;
ENABLE_BITCODE = NO;

@ -17,12 +17,15 @@ const DeepLink = ()=>{
initTranslation();
const SCHEME = 'bigbluebutton-tablet://';
const SCHEME_DEFAULT = 'https://'
var lastDeepLinkPortalName = null;
var lastDeepLinkPortalName:String|undefined = undefined;
const navigation = useNavigation();
const {portals, setPortals} = usePortal();
function decodeUrlParameter(str:string) {
return decodeURIComponent(str.replace(/\+/g, '%20'));
}
async function createPortalFromDeepLink(link: string){
const linkWithoutScheme = link.replace(SCHEME, '').replace(/\+/g, ' ');
@ -30,33 +33,30 @@ const DeepLink = ()=>{
navigation.navigate(i18next.t('mobileApp.portals.drawerNavigation.button.label'))
return Alert.alert(i18next.t('mobileApp.portals.handleWithoutURL'))
}
let roomNameWBar = linkWithoutScheme.match(/^[-.\w +]+\//)
if(!roomNameWBar) {
const linkParts = linkWithoutScheme.split('/https://');
let portalName = linkParts[0];
let portalLink = linkParts[1];
if(!portalName || !portalLink) {
navigation.navigate(i18next.t('mobileApp.portals.drawerNavigation.button.label'))
return Alert.alert(i18next.t('mobileApp.portals.handleWithoutURL'))
}
let roomName = roomNameWBar[0].replace(/\//, '')
if(roomName === 'bigbluebutton'){
roomName = i18next.t('mobileApp.portals.namePortal.deepLink');
}
lastDeepLinkPortalName = roomName;
let linkWithoutSchemeAndName = linkWithoutScheme.replace(/^[-.\w +]+\//, '')
if (!linkWithoutSchemeAndName.includes('://')) {
linkWithoutSchemeAndName = SCHEME_DEFAULT + linkWithoutSchemeAndName
}
portalName=decodeUrlParameter(portalName);
portalLink= 'https://' + decodeUrlParameter(portalLink);
// Join links are temporary (discarded on next app launch)
const isTemporary = linkWithoutScheme.includes('/bigbluebutton/api/join?');
const isTemporary = portalLink.includes('/bigbluebutton/api/join?');
const portalToAdd:IPortal = {
name: lastDeepLinkPortalName,
url: linkWithoutSchemeAndName,
name: portalName,
url: portalLink,
temporary: isTemporary
}
lastDeepLinkPortalName = portalName;
// Adding LinkedPortal to AsyncStorage
const newPortals = await createNewPortal(portalToAdd)

Loading…
Cancel
Save