diff --git a/ReactNativeClient/android/app/build.gradle b/ReactNativeClient/android/app/build.gradle index 16ec2409d3..475d07c637 100644 --- a/ReactNativeClient/android/app/build.gradle +++ b/ReactNativeClient/android/app/build.gradle @@ -153,6 +153,7 @@ dependencies { compile project(':react-native-document-picker') compile project(':react-native-image-resizer') compile project(':react-native-share-extension') + compile project(':react-native-version-info') compile "com.facebook.react:react-native:+" // To fix the error below, which happened after adding react-native-camera. diff --git a/ReactNativeClient/android/app/src/main/java/net/cozic/joplin/MainApplication.java b/ReactNativeClient/android/app/src/main/java/net/cozic/joplin/MainApplication.java index faec50565c..09f49ca70b 100644 --- a/ReactNativeClient/android/app/src/main/java/net/cozic/joplin/MainApplication.java +++ b/ReactNativeClient/android/app/src/main/java/net/cozic/joplin/MainApplication.java @@ -22,6 +22,8 @@ import org.pgsqlite.SQLitePluginPackage; import com.alinz.parkerdan.shareextension.SharePackage; +import cx.evermeet.versioninfo.RNVersionInfoPackage; + import java.util.Arrays; import java.util.List; @@ -48,7 +50,8 @@ public class MainApplication extends Application implements ReactApplication { new RNFSPackage(), new SQLitePluginPackage(), new VectorIconsPackage(), - new SharePackage() + new SharePackage(), + new RNVersionInfoPackage() ); } }; diff --git a/ReactNativeClient/android/settings.gradle b/ReactNativeClient/android/settings.gradle index 67b949be12..f547592a13 100644 --- a/ReactNativeClient/android/settings.gradle +++ b/ReactNativeClient/android/settings.gradle @@ -31,3 +31,5 @@ project(':react-native-document-picker').projectDir = new File(rootProject.proje include ':app', ':react-native-share-extension' project(':react-native-share-extension').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share-extension/android') +include ':react-native-version-info' +project(':react-native-version-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-info/android') diff --git a/ReactNativeClient/ios/Joplin.xcodeproj/project.pbxproj b/ReactNativeClient/ios/Joplin.xcodeproj/project.pbxproj index d96f82aa20..39fbf16611 100644 --- a/ReactNativeClient/ios/Joplin.xcodeproj/project.pbxproj +++ b/ReactNativeClient/ios/Joplin.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; + 065B3D792187B61200002863 /* libRNVersionInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 065B3D772187B5E300002863 /* libRNVersionInfo.a */; }; 0DAD2E67F6A14BDC8250B927 /* libRNDocumentPicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 82214D3345D846709A314868 /* libRNDocumentPicker.a */; }; 12AE298E1C0E445682922DAB /* libRNCamera.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E132B594F4FB4C96A2E2B0FF /* libRNCamera.a */; }; 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; @@ -84,6 +85,13 @@ remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; remoteInfo = RCTVibration; }; + 065B3D762187B5E300002863 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 065B3D412187B5E300002863 /* RNVersionInfo.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RNVersionInfo; + }; 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; @@ -409,6 +417,7 @@ 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 02C42EA98156482DB00BF86D /* RNDocumentPicker.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNDocumentPicker.xcodeproj; path = "../node_modules/react-native-document-picker/ios/RNDocumentPicker.xcodeproj"; sourceTree = ""; }; + 065B3D412187B5E300002863 /* RNVersionInfo.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNVersionInfo.xcodeproj; path = "../node_modules/react-native-version-info/ios/RNVersionInfo.xcodeproj"; sourceTree = ""; }; 0EB8BCAEA9AA41CAAE460443 /* libsqlite3.0.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; }; 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; @@ -463,6 +472,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 065B3D792187B61200002863 /* libRNVersionInfo.a in Frameworks */, 4DDA31241FC88F2400B5A80D /* libRCTPushNotification.a in Frameworks */, ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */, 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, @@ -544,6 +554,14 @@ name = Frameworks; sourceTree = ""; }; + 065B3D422187B5E300002863 /* Products */ = { + isa = PBXGroup; + children = ( + 065B3D772187B5E300002863 /* libRNVersionInfo.a */, + ); + name = Products; + sourceTree = ""; + }; 139105B71AF99BAD00B5F7CC /* Products */ = { isa = PBXGroup; children = ( @@ -748,6 +766,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( + 065B3D412187B5E300002863 /* RNVersionInfo.xcodeproj */, 4DDA31011FC88EEA00B5A80D /* RCTPushNotification.xcodeproj */, 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, @@ -960,6 +979,10 @@ ProductGroup = 4D2A85B71FBCE3AC0028537D /* Products */; ProjectRef = 711CBD21F0894B83A2D8E234 /* RNVectorIcons.xcodeproj */; }, + { + ProductGroup = 065B3D422187B5E300002863 /* Products */; + ProjectRef = 065B3D412187B5E300002863 /* RNVersionInfo.xcodeproj */; + }, { ProductGroup = 4D2A85B51FBCE3AC0028537D /* Products */; ProjectRef = CCDE9E9AF09B45F391B1C2AF /* SQLite.xcodeproj */; @@ -1008,6 +1031,13 @@ remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 065B3D772187B5E300002863 /* libRNVersionInfo.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNVersionInfo.a; + remoteRef = 065B3D762187B5E300002863 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; diff --git a/ReactNativeClient/lib/components/screens/config.js b/ReactNativeClient/lib/components/screens/config.js index ef56ca8449..ee05a40cea 100644 --- a/ReactNativeClient/lib/components/screens/config.js +++ b/ReactNativeClient/lib/components/screens/config.js @@ -9,9 +9,10 @@ const { themeStyle } = require('lib/components/global-style.js'); const Setting = require('lib/models/Setting.js'); const shared = require('lib/components/shared/config-shared.js'); const SyncTargetRegistry = require('lib/SyncTargetRegistry'); +import VersionInfo from 'react-native-version-info'; class ConfigScreenComponent extends BaseScreenComponent { - + static navigationOptions(options) { return { header: null }; } @@ -229,7 +230,7 @@ class ConfigScreenComponent extends BaseScreenComponent { ); - + settingComps.push( { Linking.openURL('https://joplin.cozic.net/') }}> @@ -246,6 +247,12 @@ class ConfigScreenComponent extends BaseScreenComponent { ); + settingComps.push( + + Version {VersionInfo.appVersion} + + ); + return (