rn: add build information to SettingsView

This commit is contained in:
Saúl Ibarra Corretgé 2019-04-02 10:03:01 +02:00 committed by Saúl Ibarra Corretgé
parent b791fc32fd
commit 36eb27e233
4 changed files with 28 additions and 9 deletions

View File

@ -64,6 +64,9 @@ class AppInfoModule
Map<String, Object> constants = new HashMap<>(); Map<String, Object> constants = new HashMap<>();
constants.put(
"buildNumber",
packageInfo == null ? "" : String.valueOf(packageInfo.versionCode));
constants.put( constants.put(
"name", "name",
applicationInfo == null applicationInfo == null

View File

@ -61,8 +61,15 @@ RCT_EXPORT_MODULE();
} }
} }
// build number
NSString *buildNumber = infoDictionary[@"CFBundleVersion"];
if (buildNumber == nil) {
buildNumber = @"";
}
return @{ return @{
@"calendarEnabled": [NSNumber numberWithBool:calendarEnabled], @"calendarEnabled": [NSNumber numberWithBool:calendarEnabled],
@"buildNumber": buildNumber,
@"name": name, @"name": name,
@"sdkBundlePath": sdkBundlePath, @"sdkBundlePath": sdkBundlePath,
@"version": version @"version": version

View File

@ -560,6 +560,7 @@
"alertOk": "OK", "alertOk": "OK",
"alertTitle": "Warning", "alertTitle": "Warning",
"alertURLText": "The entered server URL is invalid", "alertURLText": "The entered server URL is invalid",
"buildInfoSection": "Build Information",
"conferenceSection": "Conference", "conferenceSection": "Conference",
"displayName": "Display name", "displayName": "Display name",
"email": "Email", "email": "Email",
@ -567,7 +568,8 @@
"profileSection": "Profile", "profileSection": "Profile",
"serverURL": "Server URL", "serverURL": "Server URL",
"startWithAudioMuted": "Start with audio muted", "startWithAudioMuted": "Start with audio muted",
"startWithVideoMuted": "Start with video muted" "startWithVideoMuted": "Start with video muted",
"version": "Version"
}, },
"share": { "share": {
"dialInfoText": "\n\n=====\n\nJust want to dial in on your phone?\n\n__defaultDialInNumber__Click this link to see the dial in phone numbers for this meeting\n__dialInfoPageUrl__", "dialInfoText": "\n\n=====\n\nJust want to dial in on your phone?\n\n__defaultDialInNumber__Click this link to see the dial in phone numbers for this meeting\n__dialInfoPageUrl__",

View File

@ -1,14 +1,7 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import { import { Alert, NativeModules, SafeAreaView, ScrollView, Switch, Text, TextInput, View } from 'react-native';
Alert,
SafeAreaView,
ScrollView,
Switch,
TextInput,
View
} from 'react-native';
import { ColorSchemeRegistry } from '../../../base/color-scheme'; import { ColorSchemeRegistry } from '../../../base/color-scheme';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
@ -27,6 +20,11 @@ import { normalizeUserInputURL } from '../../functions';
import styles from './styles'; import styles from './styles';
import { HeaderLabel } from '../../../base/react/components/native'; import { HeaderLabel } from '../../../base/react/components/native';
/**
* Application information module.
*/
const { AppInfo } = NativeModules;
type Props = AbstractProps & { type Props = AbstractProps & {
/** /**
@ -193,6 +191,15 @@ class SettingsView extends AbstractSettingsView<Props> {
onValueChange = { this._onStartVideoMutedChange } onValueChange = { this._onStartVideoMutedChange }
value = { _settings.startWithVideoMuted } /> value = { _settings.startWithVideoMuted } />
</FormRow> </FormRow>
<FormSectionHeader
label = 'settingsView.buildInfoSection' />
<FormRow
fieldSeparator = { true }
label = 'settingsView.version'>
<Text>
{ `${AppInfo.version} build ${AppInfo.buildNumber}` }
</Text>
</FormRow>
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>
); );