diff --git a/android/app/google-services.json b/android/app/google-services.json
deleted file mode 100644
index f5014f14c..000000000
--- a/android/app/google-services.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "project_info": {
- "project_number": "115198584049",
- "firebase_url": "https://rocketchat-reactnative-test.firebaseio.com",
- "project_id": "rocketchat-reactnative-test",
- "storage_bucket": "rocketchat-reactnative-test.appspot.com"
- },
- "client": [
- {
- "client_info": {
- "mobilesdk_app_id": "1:115198584049:android:a79216ae48935d2c9ab550",
- "android_client_info": {
- "package_name": "chat.rocket.android"
- }
- },
- "oauth_client": [
- {
- "client_id": "115198584049-ack609b1338b827fta26s9rd2ab1aad5.apps.googleusercontent.com",
- "client_type": 3
- }
- ],
- "api_key": [
- {
- "current_key": "AIzaSyAWwowhAfACHBw3YxmDOXY3QyakgjhJLqc"
- }
- ],
- "services": {
- "appinvite_service": {
- "other_platform_oauth_client": [
- {
- "client_id": "115198584049-ack609b1338b827fta26s9rd2ab1aad5.apps.googleusercontent.com",
- "client_type": 3
- },
- {
- "client_id": "115198584049-0efgfvm0oh9ap55g7epmqnjm27mq3j4e.apps.googleusercontent.com",
- "client_type": 2,
- "ios_info": {
- "bundle_id": "chat.rocket.reactnative"
- }
- }
- ]
- }
- }
- },
- {
- "client_info": {
- "mobilesdk_app_id": "1:115198584049:android:8be27b1f7c42a2ed",
- "android_client_info": {
- "package_name": "chat.rocket.reactnative"
- }
- },
- "oauth_client": [
- {
- "client_id": "115198584049-ack609b1338b827fta26s9rd2ab1aad5.apps.googleusercontent.com",
- "client_type": 3
- }
- ],
- "api_key": [
- {
- "current_key": "AIzaSyAWwowhAfACHBw3YxmDOXY3QyakgjhJLqc"
- }
- ],
- "services": {
- "appinvite_service": {
- "other_platform_oauth_client": [
- {
- "client_id": "115198584049-ack609b1338b827fta26s9rd2ab1aad5.apps.googleusercontent.com",
- "client_type": 3
- },
- {
- "client_id": "115198584049-0efgfvm0oh9ap55g7epmqnjm27mq3j4e.apps.googleusercontent.com",
- "client_type": 2,
- "ios_info": {
- "bundle_id": "chat.rocket.reactnative"
- }
- }
- ]
- }
- }
- }
- ],
- "configuration_version": "1"
-}
\ No newline at end of file
diff --git a/android/app/src/debug/res/values/strings.xml b/android/app/src/debug/res/values/strings.xml
deleted file mode 100644
index 207352c2a..000000000
--- a/android/app/src/debug/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
- [DEBUG] Rocket.Chat Experimental
- [DEBUG] Rocket.Chat Experimental
-
diff --git a/android/gradle.properties b/android/gradle.properties
index 59600f62e..e55ef1d2b 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -39,7 +39,9 @@ newArchEnabled=false
# Application ID
APPLICATION_ID=chat.rocket.reactnative
-
-# App properties
-VERSIONCODE=999999999
-BugsnagAPIKey=""
\ No newline at end of file
+VERSIONCODE=1
+BugsnagAPIKey=""
+KEYSTORE=my-upload-key.keystore
+KEY_ALIAS=my-key-alias
+KEYSTORE_PASSWORD=
+KEY_PASSWORD=
\ No newline at end of file
diff --git a/app.json b/app.json
index 5b802fd60..a636fdb69 100644
--- a/app.json
+++ b/app.json
@@ -1,5 +1,8 @@
{
"name": "RocketChatRN",
"share": "ShareRocketChatRN",
- "displayName": "RocketChatRN"
+ "displayName": "RocketChatRN",
+ "server": "https://open.rocket.chat",
+ "appGroup": "group.ios.chat.rocket",
+ "appStoreID": "1272915472"
}
diff --git a/app/sagas/init.js b/app/sagas/init.js
index 1e6f787ce..38a934786 100644
--- a/app/sagas/init.js
+++ b/app/sagas/init.js
@@ -3,7 +3,7 @@ import RNBootSplash from 'react-native-bootsplash';
import { BIOMETRY_ENABLED_KEY, CURRENT_SERVER, TOKEN_KEY } from '../lib/constants';
import UserPreferences from '../lib/methods/userPreferences';
-import { selectServerRequest } from '../actions/server';
+import { selectServerRequest, serverRequest } from '../actions/server';
import { setAllPreferences } from '../actions/sortPreferences';
import { APP } from '../actions/actionsTypes';
import log from '../lib/methods/helpers/log';
@@ -13,6 +13,8 @@ import { appReady, appStart } from '../actions/app';
import { RootEnum } from '../definitions';
import { getSortPreferences } from '../lib/methods';
+import appConfig from '../../app.json';
+
export const initLocalSettings = function* initLocalSettings() {
const sortPreferences = getSortPreferences();
yield put(setAllPreferences(sortPreferences));
@@ -22,8 +24,8 @@ const BIOMETRY_MIGRATION_KEY = 'kBiometryMigration';
const restore = function* restore() {
try {
- const server = UserPreferences.getString(CURRENT_SERVER);
- let userId = UserPreferences.getString(`${TOKEN_KEY}-${server}`);
+ // const server = UserPreferences.getString(CURRENT_SERVER);
+ // let userId = UserPreferences.getString(`${TOKEN_KEY}-${server}`);
// Migration biometry setting from WatermelonDB to MMKV
// TODO: remove it after a few versions
@@ -37,23 +39,30 @@ const restore = function* restore() {
UserPreferences.setBool(BIOMETRY_MIGRATION_KEY, true);
}
- if (!server) {
- yield put(appStart({ root: RootEnum.ROOT_OUTSIDE }));
- } else if (!userId) {
- const serversDB = database.servers;
- const serversCollection = serversDB.get('servers');
- const servers = yield serversCollection.query().fetch();
+ // if (!server) {
+ // yield put(appStart({ root: RootEnum.ROOT_OUTSIDE }));
+ // } else if (!userId) {
+ // const serversDB = database.servers;
+ // const serversCollection = serversDB.get('servers');
+ // const servers = yield serversCollection.query().fetch();
- // Check if there're other logged in servers and picks first one
- if (servers.length > 0) {
- for (let i = 0; i < servers.length; i += 1) {
- const newServer = servers[i].id;
- userId = UserPreferences.getString(`${TOKEN_KEY}-${newServer}`);
- if (userId) {
- return yield put(selectServerRequest(newServer));
- }
- }
- }
+ // // Check if there're other logged in servers and picks first one
+ // if (servers.length > 0) {
+ // for (let i = 0; i < servers.length; i += 1) {
+ // const newServer = servers[i].id;
+ // userId = UserPreferences.getString(`${TOKEN_KEY}-${newServer}`);
+ // if (userId) {
+ // return yield put(selectServerRequest(newServer));
+ // }
+ // }
+ // }
+ const { server } = appConfig;
+ const userId = UserPreferences.getString(`${TOKEN_KEY}-${server}`);
+
+ if (!userId) {
+ UserPreferences.removeItem(TOKEN_KEY);
+ UserPreferences.removeItem(CURRENT_SERVER);
+ yield put(serverRequest(appConfig.server));
yield put(appStart({ root: RootEnum.ROOT_OUTSIDE }));
} else {
const serversDB = database.servers;
diff --git a/app/sagas/login.js b/app/sagas/login.js
index af2ad9b03..672ad8a9f 100644
--- a/app/sagas/login.js
+++ b/app/sagas/login.js
@@ -4,7 +4,7 @@ import { Q } from '@nozbe/watermelondb';
import * as types from '../actions/actionsTypes';
import { appStart } from '../actions/app';
-import { selectServerRequest, serverFinishAdd } from '../actions/server';
+import { selectServerRequest, serverFinishAdd, serverRequest } from '../actions/server';
import { loginFailure, loginSuccess, logout as logoutAction, setUser } from '../actions/login';
import { roomsRequest } from '../actions/rooms';
import log, { events, logEvent } from '../lib/methods/helpers/log';
@@ -37,6 +37,8 @@ import {
} from '../lib/methods';
import { Services } from '../lib/services';
+import appConfig from '../../app.json';
+
const getServer = state => state.server.server;
const loginWithPasswordCall = args => Services.loginWithPassword(args);
const loginCall = (credentials, isFromWebView) => Services.login(credentials, isFromWebView);
@@ -211,33 +213,17 @@ const handleLogout = function* handleLogout({ forcedByServer, message }) {
try {
yield call(logoutCall, { server });
+ yield put(appStart({ root: RootEnum.ROOT_OUTSIDE }));
+ yield put(serverRequest(appConfig.server));
+
// if the user was logged out by the server
if (forcedByServer) {
- yield put(appStart({ root: RootEnum.ROOT_OUTSIDE }));
+ // yield put(appStart({ root: RootEnum.ROOT_OUTSIDE }));
if (message) {
showErrorAlert(I18n.t(message), I18n.t('Oops'));
}
yield delay(300);
EventEmitter.emit('NewServer', { server });
- } else {
- const serversDB = database.servers;
- // all servers
- const serversCollection = serversDB.get('servers');
- const servers = yield serversCollection.query().fetch();
-
- // see if there're other logged in servers and selects first one
- if (servers.length > 0) {
- for (let i = 0; i < servers.length; i += 1) {
- const newServer = servers[i].id;
- const token = UserPreferences.getString(`${TOKEN_KEY}-${newServer}`);
- if (token) {
- yield put(selectServerRequest(newServer));
- return;
- }
- }
- }
- // if there's no servers, go outside
- yield put(appStart({ root: RootEnum.ROOT_OUTSIDE }));
}
} catch (e) {
yield put(appStart({ root: RootEnum.ROOT_OUTSIDE }));
diff --git a/app/stacks/OutsideStack.tsx b/app/stacks/OutsideStack.tsx
index 8ffc8ae85..614466665 100644
--- a/app/stacks/OutsideStack.tsx
+++ b/app/stacks/OutsideStack.tsx
@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
import { ThemeContext } from '../theme';
import { ModalAnimation, StackAnimation, defaultHeader, themedHeader } from '../lib/methods/helpers/navigation';
// Outside Stack
-import NewServerView from '../views/NewServerView';
+// import NewServerView from '../views/NewServerView';
import WorkspaceView from '../views/WorkspaceView';
import LoginView from '../views/LoginView';
import ForgotPasswordView from '../views/ForgotPasswordView';
@@ -22,7 +22,7 @@ const _OutsideStack = () => {
return (
-
+ {/* */}
diff --git a/app/views/RoomsListView/Header/Header.tsx b/app/views/RoomsListView/Header/Header.tsx
index e77686eb3..5165c7e52 100644
--- a/app/views/RoomsListView/Header/Header.tsx
+++ b/app/views/RoomsListView/Header/Header.tsx
@@ -3,7 +3,7 @@ import { StyleSheet, Text, TextInputProps, TouchableOpacity, TouchableOpacityPro
import I18n from '../../../i18n';
import sharedStyles from '../../Styles';
-import { CustomIcon } from '../../../containers/CustomIcon';
+// import { CustomIcon } from '../../../containers/CustomIcon';
import { isIOS, isTablet } from '../../../lib/methods/helpers';
import { useOrientation } from '../../../dimensions';
import { useTheme } from '../../../theme';
@@ -49,11 +49,11 @@ const Header = React.memo(
isFetching,
serverName = 'Rocket.Chat',
server,
- showServerDropdown,
+ // showServerDropdown,
showSearchHeader,
- onSearchChangeText,
- onPress
- }: IRoomHeader) => {
+ onSearchChangeText
+ }: // onPress
+ IRoomHeader) => {
const { colors } = useTheme();
const { isLandscape } = useOrientation();
const scale = isIOS && isLandscape && !isTablet ? 0.8 : 1;
@@ -75,28 +75,28 @@ const Header = React.memo(
}
return (
-
-
-
- {serverName}
-
-
-
- {subtitle ? (
-
- {subtitle}
-
- ) : null}
-
+ {/* */}
+
+
+ {serverName}
+
+ {/* */}
+
+ {subtitle ? (
+
+ {subtitle}
+
+ ) : null}
+ {/* */}
);
}
diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist
deleted file mode 100644
index 8560c91e6..000000000
--- a/ios/GoogleService-Info.plist
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
- CLIENT_ID
- 115198584049-0efgfvm0oh9ap55g7epmqnjm27mq3j4e.apps.googleusercontent.com
- REVERSED_CLIENT_ID
- com.googleusercontent.apps.115198584049-0efgfvm0oh9ap55g7epmqnjm27mq3j4e
- API_KEY
- AIzaSyDEMLMz0En0vwFBlLSQkQ9oyhmCMPcpZxc
- GCM_SENDER_ID
- 115198584049
- PLIST_VERSION
- 1
- BUNDLE_ID
- chat.rocket.reactnative
- PROJECT_ID
- rocketchat-reactnative-test
- STORAGE_BUCKET
- rocketchat-reactnative-test.appspot.com
- IS_ADS_ENABLED
-
- IS_ANALYTICS_ENABLED
-
- IS_APPINVITE_ENABLED
-
- IS_GCM_ENABLED
-
- IS_SIGNIN_ENABLED
-
- GOOGLE_APP_ID
- 1:115198584049:ios:8be27b1f7c42a2ed
- DATABASE_URL
- https://rocketchat-reactnative-test.firebaseio.com
-
-
\ No newline at end of file
diff --git a/ios/RocketChatRN.xcodeproj/project.pbxproj b/ios/RocketChatRN.xcodeproj/project.pbxproj
index a49046e74..a79042f10 100644
--- a/ios/RocketChatRN.xcodeproj/project.pbxproj
+++ b/ios/RocketChatRN.xcodeproj/project.pbxproj
@@ -46,7 +46,6 @@
1E598AE925151A63002BDFBD /* SendMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E598AE825151A63002BDFBD /* SendMessage.swift */; };
1E67380424DC529B0009E081 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E67380324DC529B0009E081 /* String+Extensions.swift */; };
1E680ED92512990700C9257A /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E680ED82512990700C9257A /* Request.swift */; };
- 1E6CC61F2513DBF400965591 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A006F13229C83B600803143 /* GoogleService-Info.plist */; };
1E76CBC2251529560067298C /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB8EF712510F1EE00F352B7 /* Storage.swift */; };
1E76CBC325152A460067298C /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E67380324DC529B0009E081 /* String+Extensions.swift */; };
1E76CBC725152BFF0067298C /* Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E01C8262511303900FEF824 /* Payload.swift */; };
@@ -74,7 +73,6 @@
1EC6ACBB22CB9FC300A41C61 /* ShareRocketChatRN.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1EC6ACB022CB9FC300A41C61 /* ShareRocketChatRN.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
1EC6ACF622CBA01500A41C61 /* ShareRocketChatRN.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EC6ACF522CBA01500A41C61 /* ShareRocketChatRN.m */; };
1ED00BB12513E04400A1331F /* ReplyNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ED00BB02513E04400A1331F /* ReplyNotification.swift */; };
- 1ED59D4C22CBA77D00C54289 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1ED59D4B22CBA77D00C54289 /* GoogleService-Info.plist */; };
1EF5FBD1250C109E00614FEA /* Encryption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EF5FBD0250C109E00614FEA /* Encryption.swift */; };
1EFEB5982493B6640072EDC0 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EFEB5972493B6640072EDC0 /* NotificationService.swift */; };
1EFEB59C2493B6640072EDC0 /* NotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1EFEB5952493B6640072EDC0 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
@@ -258,7 +256,6 @@
1EC6ACF522CBA01500A41C61 /* ShareRocketChatRN.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareRocketChatRN.m; sourceTree = ""; };
1EC6AD6022CBA20C00A41C61 /* ShareRocketChatRN.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShareRocketChatRN.entitlements; sourceTree = ""; };
1ED00BB02513E04400A1331F /* ReplyNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyNotification.swift; sourceTree = ""; };
- 1ED59D4B22CBA77D00C54289 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = SOURCE_ROOT; };
1EF5FBD0250C109E00614FEA /* Encryption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Encryption.swift; sourceTree = ""; };
1EFEB5952493B6640072EDC0 /* NotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
1EFEB5972493B6640072EDC0 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; };
@@ -358,7 +355,6 @@
13B07FAE1A68108700A75B9A /* RocketChatRN */ = {
isa = PBXGroup;
children = (
- 7A006F13229C83B600803143 /* GoogleService-Info.plist */,
60B2A6A31FC4588700BD58E5 /* RocketChatRN.entitlements */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
@@ -457,7 +453,6 @@
1EC6ACB122CB9FC300A41C61 /* ShareRocketChatRN */ = {
isa = PBXGroup;
children = (
- 1ED59D4B22CBA77D00C54289 /* GoogleService-Info.plist */,
1EC6AD6022CBA20C00A41C61 /* ShareRocketChatRN.entitlements */,
1EC6ACB522CB9FC300A41C61 /* MainInterface.storyboard */,
1EC6ACB822CB9FC300A41C61 /* Info.plist */,
@@ -1654,7 +1649,7 @@
"$(inherited)",
"$(SRCROOT)/../node_modules/rn-extensions-share/ios/**",
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
- "$PODS_CONFIGURATION_BUILD_DIR/Firebase",
+ $PODS_CONFIGURATION_BUILD_DIR/Firebase,
);
INFOPLIST_FILE = ShareRocketChatRN/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
@@ -1722,7 +1717,7 @@
"$(inherited)",
"$(SRCROOT)/../node_modules/rn-extensions-share/ios/**",
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
- "$PODS_CONFIGURATION_BUILD_DIR/Firebase",
+ $PODS_CONFIGURATION_BUILD_DIR/Firebase,
);
INFOPLIST_FILE = ShareRocketChatRN/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;