diff --git a/android/app/build.gradle b/android/app/build.gradle index f2ec7cff9..541e477b4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -144,6 +144,7 @@ android { } dependencies { + compile project(':react-native-smart-splashscreen') compile project(':react-native-orientation') compile project(':react-native-bottom-sheet') compile project(':react-native-push-notification') diff --git a/android/app/src/main/java/com/mattermost/MainActivity.java b/android/app/src/main/java/com/mattermost/MainActivity.java index 63fb8478f..76f26b7f9 100644 --- a/android/app/src/main/java/com/mattermost/MainActivity.java +++ b/android/app/src/main/java/com/mattermost/MainActivity.java @@ -7,6 +7,8 @@ import com.BV.LinearGradient.LinearGradientPackage; import com.reactnative.ivpusic.imagepicker.PickerPackage; import android.content.Intent; import android.content.res.Configuration; +import android.os.Bundle; +import com.reactnativecomponent.splashscreen.RCTSplashScreen; public class MainActivity extends ReactActivity { @@ -19,6 +21,12 @@ public class MainActivity extends ReactActivity { return "Mattermost"; } + @Override + protected void onCreate(Bundle savedInstanceState) { + RCTSplashScreen.openSplashScreen(this); + super.onCreate(savedInstanceState); + } + @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); diff --git a/android/app/src/main/java/com/mattermost/MainApplication.java b/android/app/src/main/java/com/mattermost/MainApplication.java index 3b55bf2b1..7b06dbb5c 100644 --- a/android/app/src/main/java/com/mattermost/MainApplication.java +++ b/android/app/src/main/java/com/mattermost/MainApplication.java @@ -17,6 +17,7 @@ import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import com.BV.LinearGradient.LinearGradientPackage; import com.reactnative.ivpusic.imagepicker.PickerPackage; +import com.reactnativecomponent.splashscreen.RCTSplashScreenPackage; import com.github.yamill.orientation.OrientationPackage; import java.util.Arrays; @@ -34,6 +35,7 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new RCTSplashScreenPackage(), new RNBottomSheetPackage(), new RNDeviceInfo(), new CookieManagerPackage(), diff --git a/android/app/src/main/res/drawable-hdpi/splash.png b/android/app/src/main/res/drawable-hdpi/splash.png new file mode 100644 index 000000000..a99a0b1ae Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-mdpi/splash.png b/android/app/src/main/res/drawable-mdpi/splash.png new file mode 100644 index 000000000..48c54d777 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/splash.png b/android/app/src/main/res/drawable-xhdpi/splash.png new file mode 100644 index 000000000..8cbcc176f Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/splash.png b/android/app/src/main/res/drawable-xxhdpi/splash.png new file mode 100644 index 000000000..60134180d Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/splash.png b/android/app/src/main/res/drawable-xxxhdpi/splash.png new file mode 100644 index 000000000..fc3d9d3de Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 319eb0ca1..778e66aaa 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -3,6 +3,7 @@ diff --git a/android/settings.gradle b/android/settings.gradle index 62a6eb648..3d0a39ce9 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'Mattermost' +include ':react-native-smart-splashscreen' +project(':react-native-smart-splashscreen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-smart-splash-screen/android') include ':react-native-bottom-sheet' project(':react-native-bottom-sheet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bottom-sheet/android') include ':react-native-device-info' diff --git a/app/components/root/root.js b/app/components/root/root.js index f5e3ce1cb..07bb0edf5 100644 --- a/app/components/root/root.js +++ b/app/components/root/root.js @@ -14,13 +14,15 @@ import { } from 'react-native'; import {IntlProvider} from 'react-intl'; import DeviceInfo from 'react-native-device-info'; +import SplashScreen from 'react-native-smart-splash-screen'; import semver from 'semver'; -import Config from 'assets/config'; - import PushNotification from 'app/components/push_notification'; +import {SplashScreenTypes} from 'app/constants'; import {getTranslations} from 'app/i18n'; +import Config from 'assets/config'; + import Client from 'mattermost-redux/client'; import {Constants} from 'mattermost-redux/constants'; import EventEmitter from 'mattermost-redux/utils/event_emitter'; @@ -55,6 +57,7 @@ export default class Root extends Component { componentDidMount() { AppState.addEventListener('change', this.handleAppStateChange); EventEmitter.on(Constants.CONFIG_CHANGED, this.handleConfigChanged); + EventEmitter.on(SplashScreenTypes.CLOSE, this.handleCloseSplashScreen); Client.setUserAgent(DeviceInfo.getUserAgent()); if (Platform.OS === 'android') { @@ -65,6 +68,7 @@ export default class Root extends Component { componentWillUnmount() { AppState.removeEventListener('change', this.handleAppStateChange); EventEmitter.off(Constants.CONFIG_CHANGED, this.handleConfigChanged); + EventEmitter.off(SplashScreenTypes.CLOSE, this.handleCloseSplashScreen); if (Platform.OS === 'android') { BackAndroid.removeEventListener('hardwareBackPress', this.handleAndroidBack); @@ -103,22 +107,14 @@ export default class Root extends Component { return false; }; - handleVersionUpgrade = async () => { - const {closeDrawers, logout, unrenderDrawer} = this.props.actions; + handleCloseSplashScreen = (options = {}) => { + const opts = { + animationType: SplashScreen.animationType.scale, + duration: 850, + delay: 500 + }; - Client.serverVersion = ''; - - const storage = await AsyncStorage.getItem('storage'); - if (storage) { - setTimeout(async () => { - const {token} = JSON.parse(await AsyncStorage.getItem('storage')); - if (token) { - closeDrawers(); - unrenderDrawer(); - InteractionManager.runAfterInteractions(logout); - } - }, 1000); - } + SplashScreen.close(Object.assign({}, opts, options)); }; handleConfigChanged = (serverVersion) => { @@ -140,6 +136,24 @@ export default class Root extends Component { } }; + handleVersionUpgrade = async () => { + const {closeDrawers, logout, unrenderDrawer} = this.props.actions; + + Client.serverVersion = ''; + + const storage = await AsyncStorage.getItem('storage'); + if (storage) { + setTimeout(async () => { + const {token} = JSON.parse(await AsyncStorage.getItem('storage')); + if (token) { + closeDrawers(); + unrenderDrawer(); + InteractionManager.runAfterInteractions(logout); + } + }, 1000); + } + }; + render() { const locale = this.props.locale; diff --git a/app/constants/index.js b/app/constants/index.js index 76d9737d0..580efadbf 100644 --- a/app/constants/index.js +++ b/app/constants/index.js @@ -4,9 +4,11 @@ import NavigationTypes from './navigation'; import StorageTypes from './storage'; import ViewTypes from './view'; +import SplashScreenTypes from './splash_screen'; export { NavigationTypes, + SplashScreenTypes, StorageTypes, ViewTypes }; diff --git a/app/constants/splash_screen.js b/app/constants/splash_screen.js new file mode 100644 index 000000000..09d9eb3c9 --- /dev/null +++ b/app/constants/splash_screen.js @@ -0,0 +1,8 @@ +// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import keyMirror from 'mattermost-redux/utils/key_mirror'; + +export default keyMirror({ + CLOSE: null +}); diff --git a/app/scenes/channel/channel.js b/app/scenes/channel/channel.js index 7500d4899..d5ef7b341 100644 --- a/app/scenes/channel/channel.js +++ b/app/scenes/channel/channel.js @@ -8,6 +8,7 @@ import { View } from 'react-native'; +import {SplashScreenTypes} from 'app/constants'; import KeyboardLayout from 'app/components/layout/keyboard_layout'; import Loading from 'app/components/loading'; import PostTextbox from 'app/components/post_textbox'; @@ -67,6 +68,7 @@ export default class Channel extends React.PureComponent { componentDidMount() { this.props.actions.startPeriodicStatusUpdates(); this.props.actions.renderDrawer(); + EventEmitter.emit(SplashScreenTypes.CLOSE); } componentWillReceiveProps(nextProps) { diff --git a/app/scenes/options_modal/options_modal_list.ios.js b/app/scenes/options_modal/options_modal_list.ios.js index b86da8454..83d620698 100644 --- a/app/scenes/options_modal/options_modal_list.ios.js +++ b/app/scenes/options_modal/options_modal_list.ios.js @@ -122,6 +122,7 @@ const style = StyleSheet.create({ optionCancelText: { color: '#CC3239', flex: 1, + fontSize: 20, textAlign: 'center' }, optionContainer: { @@ -136,7 +137,8 @@ const style = StyleSheet.create({ }, optionText: { color: '#4E8ACC', - flex: 1 + flex: 1, + fontSize: 20 }, optionTitleText: { color: '#7f8180', diff --git a/app/scenes/select_server/select_server.js b/app/scenes/select_server/select_server.js index 120e8b0fb..17879f273 100644 --- a/app/scenes/select_server/select_server.js +++ b/app/scenes/select_server/select_server.js @@ -12,6 +12,12 @@ import { } from 'react-native'; import Button from 'react-native-button'; + +import {RequestStatus} from 'mattermost-redux/constants'; +import Client from 'mattermost-redux/client'; +import EventEmitter from 'mattermost-redux/utils/event_emitter'; + +import {SplashScreenTypes} from 'app/constants'; import ErrorText from 'app/components/error_text'; import FormattedText from 'app/components/formatted_text'; import KeyboardLayout from 'app/components/layout/keyboard_layout'; @@ -22,9 +28,6 @@ import {isValidUrl, stripTrailingSlashes} from 'app/utils/url'; import logo from 'assets/images/logo.png'; -import {RequestStatus} from 'mattermost-redux/constants'; -import Client from 'mattermost-redux/client'; - export default class SelectServer extends PureComponent { static propTypes = { transition: PropTypes.bool.isRequired, @@ -54,6 +57,7 @@ export default class SelectServer extends PureComponent { if (Platform.OS === 'android') { Keyboard.addListener('keyboardDidHide', this.handleAndroidKeyboard); } + EventEmitter.emit(SplashScreenTypes.CLOSE); } componentWillReceiveProps(nextProps) { diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index b2caaf98f..8c004c77d 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -18,7 +18,6 @@ 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; @@ -37,6 +36,10 @@ 587E8EEB59DB4EC38F6940BF /* libimageCropPicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 37A98FBBA38D48E786B32BAD /* libimageCropPicker.a */; }; 5E1AF7B72B8D4A4E9E53FF9D /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 005346E5C0E542BFABAE1411 /* FontAwesome.ttf */; }; 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; + 7F292A711E8AB73400A450A3 /* SplashScreenResource in Resources */ = {isa = PBXBuildFile; fileRef = 7F292A701E8AB73400A450A3 /* SplashScreenResource */; }; + 7F292AA31E8AB78600A450A3 /* libRCTSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F292AA21E8AB77700A450A3 /* libRCTSplashScreen.a */; }; + 7F292AA61E8ABB1100A450A3 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7F292AA41E8ABB1100A450A3 /* LaunchScreen.xib */; }; + 7F292AA71E8ABB1100A450A3 /* splash.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F292AA51E8ABB1100A450A3 /* splash.png */; }; 7F63D2841E6C9585001FAE12 /* libRCTPushNotification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F63D2811E6C957C001FAE12 /* libRCTPushNotification.a */; }; 7F6877B31E7836070094B63F /* libToolTipMenu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F6877B01E7835E50094B63F /* libToolTipMenu.a */; }; 7FBB5E9A1E1F5A4B000DE18A /* libRNSVG.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FDF28E11E1F4B1F00DBBE56 /* libRNSVG.a */; }; @@ -254,6 +257,13 @@ remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTLinking; }; + 7F292AA11E8AB77700A450A3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7F292A9D1E8AB77700A450A3 /* RCTSplashScreen.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9F90C2241D619E9400F3E238; + remoteInfo = RCTSplashScreen; + }; 7F4890681E3B7D3B008EDBEA /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 59954D479A89488091EB588F /* RNSearchBar.xcodeproj */; @@ -351,7 +361,6 @@ 13B07F961A680F5B00A75B9A /* Mattermost.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Mattermost.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Mattermost/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Mattermost/AppDelegate.m; sourceTree = ""; }; - 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Mattermost/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Mattermost/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Mattermost/main.m; sourceTree = ""; }; @@ -371,6 +380,10 @@ 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 7DCC3D826CE640AF8F491692 /* BVLinearGradient.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = BVLinearGradient.xcodeproj; path = "../node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj"; sourceTree = ""; }; + 7F292A701E8AB73400A450A3 /* SplashScreenResource */ = {isa = PBXFileReference; lastKnownFileType = folder; path = SplashScreenResource; sourceTree = ""; }; + 7F292A9D1E8AB77700A450A3 /* RCTSplashScreen.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSplashScreen.xcodeproj; path = "../node_modules/react-native-smart-splash-screen/ios/RCTSplashScreen/RCTSplashScreen.xcodeproj"; sourceTree = ""; }; + 7F292AA41E8ABB1100A450A3 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = LaunchScreen.xib; path = SplashScreenResource/LaunchScreen.xib; sourceTree = ""; }; + 7F292AA51E8ABB1100A450A3 /* splash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = splash.png; path = SplashScreenResource/splash.png; sourceTree = ""; }; 7F63D27B1E6C957C001FAE12 /* RCTPushNotification.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTPushNotification.xcodeproj; path = "../node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj"; sourceTree = ""; }; 7F63D2C21E6DD98A001FAE12 /* Mattermost.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Mattermost.entitlements; path = Mattermost/Mattermost.entitlements; sourceTree = ""; }; 7F6877AA1E7835E50094B63F /* ToolTipMenu.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ToolTipMenu.xcodeproj; path = "../node_modules/react-native-tooltip/ToolTipMenu.xcodeproj"; sourceTree = ""; }; @@ -410,6 +423,7 @@ 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, + 7F292AA31E8AB78600A450A3 /* libRCTSplashScreen.a in Frameworks */, 374634801E8480C2005E1244 /* libRCTOrientation.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, @@ -524,12 +538,13 @@ 13B07FAE1A68108700A75B9A /* Mattermost */ = { isa = PBXGroup; children = ( + 7F292AA41E8ABB1100A450A3 /* LaunchScreen.xib */, + 7F292AA51E8ABB1100A450A3 /* splash.png */, 7F63D2C21E6DD98A001FAE12 /* Mattermost.entitlements */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.m */, 13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB61A68108700A75B9A /* Info.plist */, - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 13B07FB71A68108700A75B9A /* main.m */, ); name = Mattermost; @@ -600,6 +615,14 @@ name = Products; sourceTree = ""; }; + 7F292A9E1E8AB77700A450A3 /* Products */ = { + isa = PBXGroup; + children = ( + 7F292AA21E8AB77700A450A3 /* libRCTSplashScreen.a */, + ); + name = Products; + sourceTree = ""; + }; 7F48904C1E3B7D3B008EDBEA /* Products */ = { isa = PBXGroup; children = ( @@ -653,6 +676,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( + 7F292A9D1E8AB77700A450A3 /* RCTSplashScreen.xcodeproj */, 7F6877AA1E7835E50094B63F /* ToolTipMenu.xcodeproj */, 7F63D27B1E6C957C001FAE12 /* RCTPushNotification.xcodeproj */, 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, @@ -690,6 +714,7 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( + 7F292A701E8AB73400A450A3 /* SplashScreenResource */, 37DA4BA81E6F55D3002B058E /* QBImagePicker.framework */, 37DA4BA51E6F55D3002B058E /* RSKImageCropper.framework */, 13B07FAE1A68108700A75B9A /* Mattermost */, @@ -766,7 +791,7 @@ }; 13B07F861A680F5B00A75B9A = { DevelopmentTeam = UQ8HT4Q2XM; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Push = { enabled = 1; @@ -831,6 +856,10 @@ ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; }, + { + ProductGroup = 7F292A9E1E8AB77700A450A3 /* Products */; + ProjectRef = 7F292A9D1E8AB77700A450A3 /* RCTSplashScreen.xcodeproj */; + }, { ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; @@ -1077,6 +1106,13 @@ remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 7F292AA21E8AB77700A450A3 /* libRCTSplashScreen.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTSplashScreen.a; + remoteRef = 7F292AA11E8AB77700A450A3 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 7F4890691E3B7D3B008EDBEA /* libRNSearchBar.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1155,7 +1191,6 @@ buildActionMask = 2147483647; files = ( 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 895C9A56B94A45C1BAF568FE /* Entypo.ttf in Resources */, 3D38ABA732A34A9BB3294F90 /* EvilIcons.ttf in Resources */, 5E1AF7B72B8D4A4E9E53FF9D /* FontAwesome.ttf in Resources */, @@ -1163,7 +1198,10 @@ C337E8708D2845C6A8DBB47E /* Ionicons.ttf in Resources */, C035DB50ED2045F09923FFAE /* MaterialCommunityIcons.ttf in Resources */, F006936FC2884C24A1321FC0 /* MaterialIcons.ttf in Resources */, + 7F292AA71E8ABB1100A450A3 /* splash.png in Resources */, 420A7328E12C4B72AEF420CE /* Octicons.ttf in Resources */, + 7F292AA61E8ABB1100A450A3 /* LaunchScreen.xib in Resources */, + 7F292A711E8AB73400A450A3 /* SplashScreenResource in Resources */, 2B4C9B708010475DA575B81D /* SimpleLineIcons.ttf in Resources */, 1BCA51319AC6442991C6A208 /* Zocial.ttf in Resources */, ); @@ -1216,18 +1254,6 @@ }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 13B07FB21A68108700A75B9A /* Base */, - ); - name = LaunchScreen.xib; - path = Mattermost; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; @@ -1275,13 +1301,14 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 20; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../node_modules/react-native/Libraries/PushNotificationIOS/**", "$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**", + "$(SRCROOT)/../node_modules/react-native-smart-splash-screen/ios/RCTSplashScreen/RCTSplashScreen/**", ); INFOPLIST_FILE = Mattermost/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1292,8 +1319,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.mattermost.react.native; PRODUCT_NAME = Mattermost; - PROVISIONING_PROFILE = "49d041fa-5540-475b-90c7-4cc99954c615"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.mattermost.react.native"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -1303,13 +1330,14 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 20; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../node_modules/react-native/Libraries/PushNotificationIOS/**", "$(SRCROOT)/../node_modules/react-native-orientation/iOS/RCTOrientation/**", + "$(SRCROOT)/../node_modules/react-native-smart-splash-screen/ios/RCTSplashScreen/RCTSplashScreen/**", ); INFOPLIST_FILE = Mattermost/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1320,8 +1348,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.mattermost.react.native; PRODUCT_NAME = Mattermost; - PROVISIONING_PROFILE = "4d7f7521-3286-4c38-b9c0-e1055f5a0ff6"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.mattermost.react.native"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; diff --git a/ios/Mattermost/AppDelegate.m b/ios/Mattermost/AppDelegate.m index 4b109f197..084106cbb 100644 --- a/ios/Mattermost/AppDelegate.m +++ b/ios/Mattermost/AppDelegate.m @@ -12,6 +12,7 @@ #import #import #import "Orientation.h" +#import "RCTSplashScreen.h" @implementation AppDelegate @@ -25,6 +26,8 @@ moduleName:@"Mattermost" initialProperties:nil launchOptions:launchOptions]; + + [RCTSplashScreen open:rootView withImageNamed:@"splash"]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; diff --git a/ios/Mattermost/Base.lproj/LaunchScreen.xib b/ios/Mattermost/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 725db11a9..000000000 --- a/ios/Mattermost/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/SplashScreenResource/LaunchScreen.xib b/ios/SplashScreenResource/LaunchScreen.xib new file mode 100644 index 000000000..a7761993e --- /dev/null +++ b/ios/SplashScreenResource/LaunchScreen.xib @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/SplashScreenResource/splash.png b/ios/SplashScreenResource/splash.png new file mode 100644 index 000000000..8cbcc176f Binary files /dev/null and b/ios/SplashScreenResource/splash.png differ diff --git a/package.json b/package.json index 20ced86e8..270bcff16 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "react-native-orientation": "enahum/react-native-orientation.git", "react-native-push-notification": "2.2.1", "react-native-search-bar": "enahum/react-native-search-bar.git", + "react-native-smart-splash-screen": "2.3.3", "react-native-svg": "4.5.0", "react-native-tooltip": "5.0.0", "react-native-vector-icons": "4.0.0",