From f7b92f65ca26edb4a4a4aff28e618add36c2fa29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 24 May 2019 17:11:54 +0200 Subject: [PATCH] ios: add feature flag to enable recording on iOS --- ios/app/src/AppDelegate.m | 6 +++++ react/features/base/flags/constants.js | 6 +++++ .../toolbox/components/native/OverflowMenu.js | 25 +++++++++---------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ios/app/src/AppDelegate.m b/ios/app/src/AppDelegate.m index 374fdd6a6..1ca70f321 100644 --- a/ios/app/src/AppDelegate.m +++ b/ios/app/src/AppDelegate.m @@ -46,6 +46,12 @@ jitsiMeet.defaultConferenceOptions = [JitsiMeetConferenceOptions fromBuilder:^(JitsiMeetConferenceOptionsBuilder *builder) { builder.serverURL = [NSURL URLWithString:@"https://meet.jit.si"]; builder.welcomePageEnabled = YES; + + // Apple rejected our app because they claim requiring a + // Dropbox account for recording is not acceptable. +#if DEBUG + [builder setFeatureFlag:@"ios.recording.enabled" withBoolean:YES]; +#endif }]; [jitsiMeet application:application didFinishLaunchingWithOptions:launchOptions]; diff --git a/react/features/base/flags/constants.js b/react/features/base/flags/constants.js index 95d6c6958..28bc00a00 100644 --- a/react/features/base/flags/constants.js +++ b/react/features/base/flags/constants.js @@ -1,5 +1,11 @@ // @flow +/** + * Flag indicating if recording should be enabled in iOS. + * Default: disabled (false). + */ +export const IOS_RECORDING_ENABLED = 'ios.recording.enabled'; + /** * Flag indicating if Picture-in-Picture should be enabled. * Default: auto-detected. diff --git a/react/features/toolbox/components/native/OverflowMenu.js b/react/features/toolbox/components/native/OverflowMenu.js index 2aa954bae..0b71aa97e 100644 --- a/react/features/toolbox/components/native/OverflowMenu.js +++ b/react/features/toolbox/components/native/OverflowMenu.js @@ -4,10 +4,8 @@ import React, { Component } from 'react'; import { Platform } from 'react-native'; import { ColorSchemeRegistry } from '../../../base/color-scheme'; -import { - BottomSheet, - hideDialog -} from '../../../base/dialog'; +import { BottomSheet, hideDialog } from '../../../base/dialog'; +import { IOS_RECORDING_ENABLED, getFeatureFlag } from '../../../base/flags'; import { connect } from '../../../base/redux'; import { StyleType } from '../../../base/styles'; import { InfoDialogButton, InviteButton } from '../../../invite'; @@ -21,8 +19,6 @@ import AudioOnlyButton from './AudioOnlyButton'; import RaiseHandButton from './RaiseHandButton'; import ToggleCameraButton from './ToggleCameraButton'; -declare var __DEV__; - /** * The type of the React {@code Component} props of {@link OverflowMenu}. */ @@ -33,6 +29,11 @@ type Props = { */ _bottomSheetStyles: StyleType, + /** + * Whether the recoding button should be enabled or not. + */ + _recordingEnabled: boolean, + /** * Used for hiding the dialog when the selection was completed. */ @@ -86,11 +87,7 @@ class OverflowMenu extends Component { { - - // Apple rejected our app because they claim requiring a - // Dropbox account for recording is not acceptable. - // Ddisable it until we can find a way around it. - (__DEV__ || Platform.OS !== 'ios') + this.props._recordingEnabled && } @@ -121,13 +118,15 @@ class OverflowMenu extends Component { * @param {Object} state - Redux state. * @private * @returns {{ - * _bottomSheetStyles: StyleType + * _bottomSheetStyles: StyleType, + * _recordingEnabled: boolean * }} */ function _mapStateToProps(state) { return { _bottomSheetStyles: - ColorSchemeRegistry.get(state, 'BottomSheet') + ColorSchemeRegistry.get(state, 'BottomSheet'), + _recordingEnabled: Platform.OS !== 'ios' || getFeatureFlag(state, IOS_RECORDING_ENABLED) }; }