From 36eb27e2331ede989424550773af01563787325b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 2 Apr 2019 10:03:01 +0200 Subject: [PATCH] rn: add build information to SettingsView --- .../org/jitsi/meet/sdk/AppInfoModule.java | 3 +++ ios/sdk/src/AppInfo.m | 7 ++++++ lang/main.json | 4 +++- .../components/native/SettingsView.js | 23 ++++++++++++------- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/AppInfoModule.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/AppInfoModule.java index d06e71dc42..adf6bb1fd1 100644 --- a/android/sdk/src/main/java/org/jitsi/meet/sdk/AppInfoModule.java +++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/AppInfoModule.java @@ -64,6 +64,9 @@ class AppInfoModule Map constants = new HashMap<>(); + constants.put( + "buildNumber", + packageInfo == null ? "" : String.valueOf(packageInfo.versionCode)); constants.put( "name", applicationInfo == null diff --git a/ios/sdk/src/AppInfo.m b/ios/sdk/src/AppInfo.m index 0b827cfc18..37bb69e364 100644 --- a/ios/sdk/src/AppInfo.m +++ b/ios/sdk/src/AppInfo.m @@ -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 diff --git a/lang/main.json b/lang/main.json index 06c40bf71d..ecd2f6c6e4 100644 --- a/lang/main.json +++ b/lang/main.json @@ -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__", diff --git a/react/features/settings/components/native/SettingsView.js b/react/features/settings/components/native/SettingsView.js index 747b6ee33f..62d5329ec2 100644 --- a/react/features/settings/components/native/SettingsView.js +++ b/react/features/settings/components/native/SettingsView.js @@ -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 { onValueChange = { this._onStartVideoMutedChange } value = { _settings.startWithVideoMuted } /> + + + + { `${AppInfo.version} build ${AppInfo.buildNumber}` } + + );