ios: add feature flag to enable recording on iOS

This commit is contained in:
Saúl Ibarra Corretgé 2019-05-24 17:11:54 +02:00 committed by Saúl Ibarra Corretgé
parent cf7b10d53d
commit f7b92f65ca
3 changed files with 24 additions and 13 deletions

View File

@ -46,6 +46,12 @@
jitsiMeet.defaultConferenceOptions = [JitsiMeetConferenceOptions fromBuilder:^(JitsiMeetConferenceOptionsBuilder *builder) { jitsiMeet.defaultConferenceOptions = [JitsiMeetConferenceOptions fromBuilder:^(JitsiMeetConferenceOptionsBuilder *builder) {
builder.serverURL = [NSURL URLWithString:@"https://meet.jit.si"]; builder.serverURL = [NSURL URLWithString:@"https://meet.jit.si"];
builder.welcomePageEnabled = YES; 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]; [jitsiMeet application:application didFinishLaunchingWithOptions:launchOptions];

View File

@ -1,5 +1,11 @@
// @flow // @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. * Flag indicating if Picture-in-Picture should be enabled.
* Default: auto-detected. * Default: auto-detected.

View File

@ -4,10 +4,8 @@ import React, { Component } from 'react';
import { Platform } from 'react-native'; import { Platform } from 'react-native';
import { ColorSchemeRegistry } from '../../../base/color-scheme'; import { ColorSchemeRegistry } from '../../../base/color-scheme';
import { import { BottomSheet, hideDialog } from '../../../base/dialog';
BottomSheet, import { IOS_RECORDING_ENABLED, getFeatureFlag } from '../../../base/flags';
hideDialog
} from '../../../base/dialog';
import { connect } from '../../../base/redux'; import { connect } from '../../../base/redux';
import { StyleType } from '../../../base/styles'; import { StyleType } from '../../../base/styles';
import { InfoDialogButton, InviteButton } from '../../../invite'; import { InfoDialogButton, InviteButton } from '../../../invite';
@ -21,8 +19,6 @@ import AudioOnlyButton from './AudioOnlyButton';
import RaiseHandButton from './RaiseHandButton'; import RaiseHandButton from './RaiseHandButton';
import ToggleCameraButton from './ToggleCameraButton'; import ToggleCameraButton from './ToggleCameraButton';
declare var __DEV__;
/** /**
* The type of the React {@code Component} props of {@link OverflowMenu}. * The type of the React {@code Component} props of {@link OverflowMenu}.
*/ */
@ -33,6 +29,11 @@ type Props = {
*/ */
_bottomSheetStyles: StyleType, _bottomSheetStyles: StyleType,
/**
* Whether the recoding button should be enabled or not.
*/
_recordingEnabled: boolean,
/** /**
* Used for hiding the dialog when the selection was completed. * Used for hiding the dialog when the selection was completed.
*/ */
@ -86,11 +87,7 @@ class OverflowMenu extends Component<Props> {
<RoomLockButton { ...buttonProps } /> <RoomLockButton { ...buttonProps } />
<ClosedCaptionButton { ...buttonProps } /> <ClosedCaptionButton { ...buttonProps } />
{ {
this.props._recordingEnabled
// 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')
&& <RecordButton { ...buttonProps } /> && <RecordButton { ...buttonProps } />
} }
<LiveStreamButton { ...buttonProps } /> <LiveStreamButton { ...buttonProps } />
@ -121,13 +118,15 @@ class OverflowMenu extends Component<Props> {
* @param {Object} state - Redux state. * @param {Object} state - Redux state.
* @private * @private
* @returns {{ * @returns {{
* _bottomSheetStyles: StyleType * _bottomSheetStyles: StyleType,
* _recordingEnabled: boolean
* }} * }}
*/ */
function _mapStateToProps(state) { function _mapStateToProps(state) {
return { return {
_bottomSheetStyles: _bottomSheetStyles:
ColorSchemeRegistry.get(state, 'BottomSheet') ColorSchemeRegistry.get(state, 'BottomSheet'),
_recordingEnabled: Platform.OS !== 'ios' || getFeatureFlag(state, IOS_RECORDING_ENABLED)
}; };
} }