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<>();
constants.put(
"buildNumber",
packageInfo == null ? "" : String.valueOf(packageInfo.versionCode));
constants.put(
"name",
applicationInfo == null

View File

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

View File

@ -560,6 +560,7 @@
"alertOk": "OK",
"alertTitle": "Warning",
"alertURLText": "The entered server URL is invalid",
"buildInfoSection": "Build Information",
"conferenceSection": "Conference",
"displayName": "Display name",
"email": "Email",
@ -567,7 +568,8 @@
"profileSection": "Profile",
"serverURL": "Server URL",
"startWithAudioMuted": "Start with audio muted",
"startWithVideoMuted": "Start with video muted"
"startWithVideoMuted": "Start with video muted",
"version": "Version"
},
"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__",

View File

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