diff --git a/android/app/google-services.json b/android/app/google-services.json deleted file mode 100644 index f5014f14c1..0000000000 --- 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 207352c2a8..0000000000 --- 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 29d16769c9..64de8a18cd 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 5b802fd60f..a636fdb693 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 5de30417d1..4fad701886 100644 --- a/app/sagas/init.js +++ b/app/sagas/init.js @@ -4,7 +4,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; 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'; @@ -15,6 +15,8 @@ import { RootEnum } from '../definitions'; import { getSortPreferences } from '../lib/methods'; import { deepLinkingClickCallPush } from '../actions/deepLinking'; +import appConfig from '../../app.json'; + export const initLocalSettings = function* initLocalSettings() { const sortPreferences = getSortPreferences(); yield put(setAllPreferences(sortPreferences)); @@ -24,8 +26,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 @@ -39,23 +41,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 3dd84034b0..e2fbd68db9 100644 --- a/app/sagas/login.js +++ b/app/sagas/login.js @@ -6,7 +6,7 @@ import { Q } from '@nozbe/watermelondb'; import moment from 'moment'; 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'; @@ -45,6 +45,8 @@ import appNavigation from '../lib/navigation/appNavigation'; import { showActionSheetRef } from '../containers/ActionSheet'; import { SupportedVersionsWarning } from '../containers/SupportedVersions'; +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); @@ -251,33 +253,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 40a3c9cb18..99e7f27f85 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 ( - + {/* */} {/* @ts-ignore */} diff --git a/app/views/ChangeAvatarView/index.tsx b/app/views/ChangeAvatarView/index.tsx index fdfe013cf0..aad8314d30 100644 --- a/app/views/ChangeAvatarView/index.tsx +++ b/app/views/ChangeAvatarView/index.tsx @@ -165,8 +165,7 @@ const ChangeAvatarView = () => { + {...scrollPersistTaps}> {deletingRoomAvatar ? ( { + onSearchChangeText + }: // onPress + IRoomHeader) => { const { status: supportedVersionsStatus } = useAppSelector(state => state.supportedVersions); const { colors } = useTheme(); @@ -75,28 +75,27 @@ const Header = React.memo( } return ( - - - - {serverName} - - */} + + + {serverName} + + {/* - - {subtitle ? ( - - {subtitle} - - ) : null} - + /> */} + + {subtitle ? ( + + {subtitle} + + ) : null} + {/* */} ); } diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist deleted file mode 100644 index 8560c91e6e..0000000000 --- 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 e6ef83461d..797010a533 100644 --- a/ios/RocketChatRN.xcodeproj/project.pbxproj +++ b/ios/RocketChatRN.xcodeproj/project.pbxproj @@ -287,7 +287,6 @@ 4C4C8603EF082F0A33A95522 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45D5C142B655F8EFD006792C /* ExpoModulesProvider.swift */; }; 65B9A71A2AFC24190088956F /* ringtone.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 65B9A7192AFC24190088956F /* ringtone.mp3 */; }; 65B9A71B2AFC24190088956F /* ringtone.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 65B9A7192AFC24190088956F /* ringtone.mp3 */; }; - 7A006F14229C83B600803143 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A006F13229C83B600803143 /* GoogleService-Info.plist */; }; 7A0D62D2242AB187006D5C06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A0D62D1242AB187006D5C06 /* LaunchScreen.storyboard */; }; 7A14FCED257FEB3A005BDCD4 /* Experimental.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7A14FCEC257FEB3A005BDCD4 /* Experimental.xcassets */; }; 7A14FCF4257FEB59005BDCD4 /* Official.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7A14FCF3257FEB59005BDCD4 /* Official.xcassets */; }; @@ -338,7 +337,6 @@ 7AAB3E3E257E6A6E00707CF6 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 06BB44DD4855498082A744AD /* libz.tbd */; }; 7AAB3E3F257E6A6E00707CF6 /* libWatermelonDB.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA7E862283664608B3894E34 /* libWatermelonDB.a */; }; 7AAB3E42257E6A6E00707CF6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 7AAB3E44257E6A6E00707CF6 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A006F13229C83B600803143 /* GoogleService-Info.plist */; }; 7AAB3E45257E6A6E00707CF6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A0D62D1242AB187006D5C06 /* LaunchScreen.storyboard */; }; 7AAB3E49257E6A6E00707CF6 /* ShareRocketChatRN.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1EC6ACB022CB9FC300A41C61 /* ShareRocketChatRN.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 7AAB3E4A257E6A6E00707CF6 /* NotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1EFEB5952493B6640072EDC0 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -715,7 +713,6 @@ isa = PBXGroup; children = ( 65B9A7192AFC24190088956F /* ringtone.mp3 */, - 7A006F13229C83B600803143 /* GoogleService-Info.plist */, 60B2A6A31FC4588700BD58E5 /* RocketChatRN.entitlements */, 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, @@ -972,7 +969,6 @@ 1EC6ACB122CB9FC300A41C61 /* ShareRocketChatRN */ = { isa = PBXGroup; children = ( - 1ED59D4B22CBA77D00C54289 /* GoogleService-Info.plist */, 1EC6AD6022CBA20C00A41C61 /* ShareRocketChatRN.entitlements */, 1EC6ACB522CB9FC300A41C61 /* MainInterface.storyboard */, 1EC6ACB822CB9FC300A41C61 /* Info.plist */, @@ -1483,7 +1479,6 @@ 7A610CD227ECE38100B8ABDD /* custom.ttf in Resources */, 7A14FCED257FEB3A005BDCD4 /* Experimental.xcassets in Resources */, 7AE10C0628A59530003593CB /* Inter.ttf in Resources */, - 7A006F14229C83B600803143 /* GoogleService-Info.plist in Resources */, 7A0D62D2242AB187006D5C06 /* LaunchScreen.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1494,7 +1489,6 @@ files = ( 7A610CD327ECE38100B8ABDD /* custom.ttf in Resources */, 1EC6ACB722CB9FC300A41C61 /* MainInterface.storyboard in Resources */, - 1ED59D4C22CBA77D00C54289 /* GoogleService-Info.plist in Resources */, 7AE10C0728A59530003593CB /* Inter.ttf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1525,7 +1519,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1E6CC61F2513DBF400965591 /* GoogleService-Info.plist in Resources */, 7A610CD427ECE38100B8ABDD /* custom.ttf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1539,7 +1532,6 @@ 7A610CD527ECE38100B8ABDD /* custom.ttf in Resources */, 7AAB3E42257E6A6E00707CF6 /* Images.xcassets in Resources */, 7AE10C0828A59530003593CB /* Inter.ttf in Resources */, - 7AAB3E44257E6A6E00707CF6 /* GoogleService-Info.plist in Resources */, 7AAB3E45257E6A6E00707CF6 /* LaunchScreen.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0;