From b31455814f69a1679462fe7acbd3682b3b7a93fa Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Tue, 10 Jan 2023 10:06:15 -0800 Subject: [PATCH 1/2] removing firebase dependency for f-droiod build --- app/mobile/android/app/build.gradle | 1 - app/mobile/android/app/google-services.json | 39 ----------- app/mobile/android/build.gradle | 1 - app/mobile/index.js | 5 -- app/mobile/package.json | 2 - app/mobile/src/context/useAppContext.hook.js | 13 +--- app/mobile/yarn.lock | 72 +------------------- 7 files changed, 4 insertions(+), 129 deletions(-) delete mode 100644 app/mobile/android/app/google-services.json diff --git a/app/mobile/android/app/build.gradle b/app/mobile/android/app/build.gradle index 2749ece0..a8442c54 100644 --- a/app/mobile/android/app/build.gradle +++ b/app/mobile/android/app/build.gradle @@ -1,5 +1,4 @@ apply plugin: "com.android.application" -apply plugin: 'com.google.gms.google-services' import com.android.build.OutputFile import org.apache.tools.ant.taskdefs.condition.Os diff --git a/app/mobile/android/app/google-services.json b/app/mobile/android/app/google-services.json deleted file mode 100644 index 92f4dcb5..00000000 --- a/app/mobile/android/app/google-services.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "project_info": { - "project_number": "627079362503", - "project_id": "databag-b46e0", - "storage_bucket": "databag-b46e0.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:627079362503:android:6f3dfcb2c255787b4a8be2", - "android_client_info": { - "package_name": "com.databag" - } - }, - "oauth_client": [ - { - "client_id": "627079362503-8bk8o4hcv5rgdgrhik6nu9cjp3poisv7.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyAb92cvtSnaoQzhbDizg0dFskOtZFp_58M" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "627079362503-8bk8o4hcv5rgdgrhik6nu9cjp3poisv7.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - } - ], - "configuration_version": "1" -} diff --git a/app/mobile/android/build.gradle b/app/mobile/android/build.gradle index 8724f167..3697576a 100644 --- a/app/mobile/android/build.gradle +++ b/app/mobile/android/build.gradle @@ -29,7 +29,6 @@ buildscript { classpath('com.android.tools.build:gradle:7.1.1') classpath('com.facebook.react:react-native-gradle-plugin') classpath('de.undercouch:gradle-download-task:5.0.1') - classpath 'com.google.gms:google-services:4.3.14' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/app/mobile/index.js b/app/mobile/index.js index 18095644..e156b9f2 100644 --- a/app/mobile/index.js +++ b/app/mobile/index.js @@ -1,11 +1,6 @@ import 'react-native-gesture-handler'; import { registerRootComponent } from 'expo'; import App from './App'; -import messaging from '@react-native-firebase/messaging'; - -messaging().registerDeviceForRemoteMessages().then(() => {}); - -messaging().setBackgroundMessageHandler(async remoteMessage => {}); // registerRootComponent calls AppRegistry.registerComponent('main', () => App); // It also ensures that whether you load the app in Expo Go or in a native build, diff --git a/app/mobile/package.json b/app/mobile/package.json index 1467aec1..a48682ad 100644 --- a/app/mobile/package.json +++ b/app/mobile/package.json @@ -10,8 +10,6 @@ }, "dependencies": { "@react-native-clipboard/clipboard": "^1.11.1", - "@react-native-firebase/app": "^16.4.3", - "@react-native-firebase/messaging": "^16.4.3", "@react-navigation/bottom-tabs": "^6.4.0", "@react-navigation/drawer": "^6.5.0", "@react-navigation/native": "^6.0.13", diff --git a/app/mobile/src/context/useAppContext.hook.js b/app/mobile/src/context/useAppContext.hook.js index 8a310874..b6069321 100644 --- a/app/mobile/src/context/useAppContext.hook.js +++ b/app/mobile/src/context/useAppContext.hook.js @@ -12,14 +12,13 @@ import { ProfileContext } from 'context/ProfileContext'; import { CardContext } from 'context/CardContext'; import { ChannelContext } from 'context/ChannelContext'; import { getVersion, getApplicationName, getDeviceId } from 'react-native-device-info'; -import messaging from '@react-native-firebase/messaging'; export function useAppContext() { const [state, setState] = useState({ session: null, loginTimestamp: null, disconnected: null, - deviceToken: null, + deviceToken: '', loggingOut: false, version: getVersion(), }); @@ -38,10 +37,6 @@ export function useAppContext() { } useEffect(() => { - messaging().getToken().then(token => { - updateState({ deviceToken: token }); - }) - init(); }, []); @@ -75,12 +70,6 @@ export function useAppContext() { } const notifications = [ - { event: 'contact.addCard', messageTitle: 'New Contact Request' }, - { event: 'contact.updateCard', messageTitle: 'Contact Update' }, - { event: 'content.addChannel.superbasic', messageTitle: 'New Topic' }, - { event: 'content.addChannel.sealed', messageTitle: 'New Topic' }, - { event: 'content.addChannelTopic.superbasic', messageTitle: 'New Topic Message' }, - { event: 'content.addChannelTopic.sealed', messageTitle: 'New Topic Message' }, ]; const actions = { diff --git a/app/mobile/yarn.lock b/app/mobile/yarn.lock index fd760c20..8f96bca3 100644 --- a/app/mobile/yarn.lock +++ b/app/mobile/yarn.lock @@ -1311,7 +1311,7 @@ node-forge "^1.2.1" nullthrows "^1.1.1" -"@expo/config-plugins@^5.0.1", "@expo/config-plugins@~5.0.0", "@expo/config-plugins@~5.0.1": +"@expo/config-plugins@~5.0.0", "@expo/config-plugins@~5.0.1": version "5.0.1" resolved "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-5.0.1.tgz" integrity sha512-1OfnsOrfeSkB0VZfT01UjQ5Uq6p+yYbq8yNkj0e99K/6NLHpyvIxj+5tZIV0nQXgkOcqBIABL2uA7lwB8CkaBQ== @@ -2147,20 +2147,6 @@ prompts "^2.4.0" semver "^6.3.0" -"@react-native-firebase/app@^16.4.3": - version "16.4.3" - resolved "https://registry.npmjs.org/@react-native-firebase/app/-/app-16.4.3.tgz" - integrity sha512-6cXm4D3CIVK3N8WMAz+vL/rzjKmoAuFdtdnjLTYsFU/fsQGcsKkZSGiWfMbZASCwcnspRR1/FjyRC5Y4tzqiuA== - dependencies: - "@expo/config-plugins" "^5.0.1" - opencollective-postinstall "^2.0.1" - superstruct "^0.6.2" - -"@react-native-firebase/messaging@^16.4.3": - version "16.4.3" - resolved "https://registry.npmjs.org/@react-native-firebase/messaging/-/messaging-16.4.3.tgz" - integrity sha512-6DLfijnyQ7Ew7csVMN1IwLTv2aZS+Jk7Zi1DV/2M8sen2Zq31b+pl5keXEN/vMeQo93/qKkG9SiFjoQI9kNGXA== - "@react-native/assets@1.0.0": version "1.0.0" resolved "https://registry.npmjs.org/@react-native/assets/-/assets-1.0.0.tgz" @@ -3249,16 +3235,6 @@ cliui@^8.0.1: strip-ansi "^6.0.1" wrap-ansi "^7.0.0" -clone-deep@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-2.0.2.tgz" - integrity sha512-SZegPTKjCgpQH63E+eN6mVEEPdQBOUzjyJm5Pora4lrwWRFS8I0QAxV/KD6vV/i0WuijHZWQC1fMsPEdxfdVCQ== - dependencies: - for-own "^1.0.0" - is-plain-object "^2.0.4" - kind-of "^6.0.0" - shallow-clone "^1.0.0" - clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz" @@ -4252,23 +4228,11 @@ fontfaceobserver@^2.1.0: resolved "https://registry.npmjs.org/fontfaceobserver/-/fontfaceobserver-2.3.0.tgz" integrity sha512-6FPvD/IVyT4ZlNe7Wcn5Fb/4ChigpucKYSvD6a+0iMoLn2inpo711eyIcKjmDtE5XNcgAkSH9uN/nfAeZzHEfg== -for-in@^0.1.3: - version "0.1.8" - resolved "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz" - integrity sha512-F0to7vbBSHP8E3l6dCjxNOLuSFAACIxFy3UehTUlG7svlXi37HHsDkyVcHo0Pq8QwrE+pXvWSVX3ZT1T9wAZ9g== - -for-in@^1.0.1, for-in@^1.0.2: +for-in@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== -for-own@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz" - integrity sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg== - dependencies: - for-in "^1.0.1" - form-data@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" @@ -5792,7 +5756,7 @@ kind-of@^5.0.0: resolved "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== -kind-of@^6.0.0, kind-of@^6.0.1, kind-of@^6.0.2: +kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.3" resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -6372,14 +6336,6 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mixin-object@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz" - integrity sha512-ALGF1Jt9ouehcaXaHhn6t1yGWRqGaHkPFndtFVHfZXOvkIZ/yoGaSi0AHVTafb3ZBGg4dr/bDwnaEKqCXzchMA== - dependencies: - for-in "^0.1.3" - is-extendable "^0.1.1" - mkdirp@^0.5.1, mkdirp@~0.5.1: version "0.5.6" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" @@ -6679,11 +6635,6 @@ open@^8.0.4, open@^8.3.0: is-docker "^2.1.1" is-wsl "^2.2.0" -opencollective-postinstall@^2.0.1: - version "2.0.3" - resolved "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz" - integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== - ora@3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/ora/-/ora-3.4.0.tgz" @@ -7787,15 +7738,6 @@ shaka-player@^2.5.9: dependencies: eme-encryption-scheme-polyfill "^2.0.1" -shallow-clone@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-1.0.0.tgz" - integrity sha512-oeXreoKR/SyNJtRJMAKPDSvd28OqEwG4eR/xc856cRGBII7gX9lvAqDxusPm0846z/w/hWYjI1NpKwJ00NHzRA== - dependencies: - is-extendable "^0.1.1" - kind-of "^5.0.0" - mixin-object "^2.0.1" - shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz" @@ -8144,14 +8086,6 @@ sudo-prompt@^9.0.0: resolved "https://registry.npmjs.org/sudo-prompt/-/sudo-prompt-9.2.1.tgz" integrity sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw== -superstruct@^0.6.2: - version "0.6.2" - resolved "https://registry.npmjs.org/superstruct/-/superstruct-0.6.2.tgz" - integrity sha512-lvA97MFAJng3rfjcafT/zGTSWm6Tbpk++DP6It4Qg7oNaeM+2tdJMuVgGje21/bIpBEs6iQql1PJH6dKTjl4Ig== - dependencies: - clone-deep "^2.0.1" - kind-of "^6.0.1" - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" From 28c90a1d083253adf1c5858d4bb755dfd02a1478 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Tue, 10 Jan 2023 10:15:57 -0800 Subject: [PATCH 2/2] removing additional runtime firebase dependency --- .../ios/Databag.xcodeproj/project.pbxproj | 32 ------- app/mobile/ios/Databag/AppDelegate.h | 1 - app/mobile/ios/Databag/AppDelegate.mm | 1 - app/mobile/ios/Podfile.lock | 96 ++----------------- app/mobile/src/context/useAppContext.hook.js | 12 --- .../src/context/useStoreContext.hook.js | 2 +- 6 files changed, 7 insertions(+), 137 deletions(-) diff --git a/app/mobile/ios/Databag.xcodeproj/project.pbxproj b/app/mobile/ios/Databag.xcodeproj/project.pbxproj index 162ba0d5..20f269d4 100644 --- a/app/mobile/ios/Databag.xcodeproj/project.pbxproj +++ b/app/mobile/ios/Databag.xcodeproj/project.pbxproj @@ -162,7 +162,6 @@ 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */, C3F23704BD150798D09CFCE9 /* [CP] Embed Pods Frameworks */, - CD7F041910A9FF36140B1AE7 /* [CP-User] [RNFB] Core Configuration */, ); buildRules = ( ); @@ -286,14 +285,6 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Databag/Pods-Databag-frameworks.sh", "${BUILT_PRODUCTS_DIR}/DoubleConversion/DoubleConversion.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreExtension/FirebaseCoreExtension.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework", - "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", - "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", - "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", "${BUILT_PRODUCTS_DIR}/RCT-Folly/folly.framework", "${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework", "${BUILT_PRODUCTS_DIR}/RNCClipboard/RNCClipboard.framework", @@ -326,7 +317,6 @@ "${BUILT_PRODUCTS_DIR}/Yoga/yoga.framework", "${BUILT_PRODUCTS_DIR}/fmt/fmt.framework", "${BUILT_PRODUCTS_DIR}/glog/glog.framework", - "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", "${BUILT_PRODUCTS_DIR}/react-native-document-picker/react_native_document_picker.framework", "${BUILT_PRODUCTS_DIR}/react-native-rsa-native/react_native_rsa_native.framework", "${BUILT_PRODUCTS_DIR}/react-native-safe-area-context/react_native_safe_area_context.framework", @@ -335,14 +325,6 @@ name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoubleConversion.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreExtension.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/folly.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCClipboard.framework", @@ -375,7 +357,6 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fmt.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_document_picker.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_rsa_native.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_safe_area_context.framework", @@ -386,19 +367,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Databag/Pods-Databag-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - CD7F041910A9FF36140B1AE7 /* [CP-User] [RNFB] Core Configuration */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)", - ); - name = "[CP-User] [RNFB] Core Configuration"; - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "#!/usr/bin/env bash\n#\n# Copyright (c) 2016-present Invertase Limited & Contributors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this library except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nset -e\n\n_MAX_LOOKUPS=2;\n_SEARCH_RESULT=''\n_RN_ROOT_EXISTS=''\n_CURRENT_LOOKUPS=1\n_JSON_ROOT=\"'react-native'\"\n_JSON_FILE_NAME='firebase.json'\n_JSON_OUTPUT_BASE64='e30=' # { }\n_CURRENT_SEARCH_DIR=${PROJECT_DIR}\n_PLIST_BUDDY=/usr/libexec/PlistBuddy\n_TARGET_PLIST=\"${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}\"\n_DSYM_PLIST=\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist\"\n\n# plist arrays\n_PLIST_ENTRY_KEYS=()\n_PLIST_ENTRY_TYPES=()\n_PLIST_ENTRY_VALUES=()\n\nfunction setPlistValue {\n echo \"info: setting plist entry '$1' of type '$2' in file '$4'\"\n ${_PLIST_BUDDY} -c \"Add :$1 $2 '$3'\" $4 || echo \"info: '$1' already exists\"\n}\n\nfunction getFirebaseJsonKeyValue () {\n if [[ ${_RN_ROOT_EXISTS} ]]; then\n ruby -Ku -e \"require 'rubygems';require 'json'; output=JSON.parse('$1'); puts output[$_JSON_ROOT]['$2']\"\n else\n echo \"\"\n fi;\n}\n\nfunction jsonBoolToYesNo () {\n if [[ $1 == \"false\" ]]; then\n echo \"NO\"\n elif [[ $1 == \"true\" ]]; then\n echo \"YES\"\n else echo \"NO\"\n fi\n}\n\necho \"info: -> RNFB build script started\"\necho \"info: 1) Locating ${_JSON_FILE_NAME} file:\"\n\nif [[ -z ${_CURRENT_SEARCH_DIR} ]]; then\n _CURRENT_SEARCH_DIR=$(pwd)\nfi;\n\nwhile true; do\n _CURRENT_SEARCH_DIR=$(dirname \"$_CURRENT_SEARCH_DIR\")\n if [[ \"$_CURRENT_SEARCH_DIR\" == \"/\" ]] || [[ ${_CURRENT_LOOKUPS} -gt ${_MAX_LOOKUPS} ]]; then break; fi;\n echo \"info: ($_CURRENT_LOOKUPS of $_MAX_LOOKUPS) Searching in '$_CURRENT_SEARCH_DIR' for a ${_JSON_FILE_NAME} file.\"\n _SEARCH_RESULT=$(find \"$_CURRENT_SEARCH_DIR\" -maxdepth 2 -name ${_JSON_FILE_NAME} -print | /usr/bin/head -n 1)\n if [[ ${_SEARCH_RESULT} ]]; then\n echo \"info: ${_JSON_FILE_NAME} found at $_SEARCH_RESULT\"\n break;\n fi;\n _CURRENT_LOOKUPS=$((_CURRENT_LOOKUPS+1))\ndone\n\nif [[ ${_SEARCH_RESULT} ]]; then\n _JSON_OUTPUT_RAW=$(cat \"${_SEARCH_RESULT}\")\n _RN_ROOT_EXISTS=$(ruby -Ku -e \"require 'rubygems';require 'json'; output=JSON.parse('$_JSON_OUTPUT_RAW'); puts output[$_JSON_ROOT]\" || echo '')\n\n if [[ ${_RN_ROOT_EXISTS} ]]; then\n if ! python3 --version >/dev/null 2>&1; then echo \"python3 not found, firebase.json file processing error.\" && exit 1; fi\n _JSON_OUTPUT_BASE64=$(python3 -c 'import json,sys,base64;print(base64.b64encode(bytes(json.dumps(json.loads(open('\"'${_SEARCH_RESULT}'\"', '\"'rb'\"').read())['${_JSON_ROOT}']), '\"'utf-8'\"')).decode())' || echo \"e30=\")\n fi\n\n _PLIST_ENTRY_KEYS+=(\"firebase_json_raw\")\n _PLIST_ENTRY_TYPES+=(\"string\")\n _PLIST_ENTRY_VALUES+=(\"$_JSON_OUTPUT_BASE64\")\n\n # config.app_data_collection_default_enabled\n _APP_DATA_COLLECTION_ENABLED=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"app_data_collection_default_enabled\")\n if [[ $_APP_DATA_COLLECTION_ENABLED ]]; then\n _PLIST_ENTRY_KEYS+=(\"FirebaseDataCollectionDefaultEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_APP_DATA_COLLECTION_ENABLED\")\")\n fi\n\n # config.analytics_auto_collection_enabled\n _ANALYTICS_AUTO_COLLECTION=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"analytics_auto_collection_enabled\")\n if [[ $_ANALYTICS_AUTO_COLLECTION ]]; then\n _PLIST_ENTRY_KEYS+=(\"FIREBASE_ANALYTICS_COLLECTION_ENABLED\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_ANALYTICS_AUTO_COLLECTION\")\")\n fi\n\n # config.analytics_collection_deactivated\n _ANALYTICS_DEACTIVATED=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"analytics_collection_deactivated\")\n if [[ $_ANALYTICS_DEACTIVATED ]]; then\n _PLIST_ENTRY_KEYS+=(\"FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_ANALYTICS_DEACTIVATED\")\")\n fi\n\n # config.analytics_idfv_collection_enabled\n _ANALYTICS_IDFV_COLLECTION=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"analytics_idfv_collection_enabled\")\n if [[ $_ANALYTICS_IDFV_COLLECTION ]]; then\n _PLIST_ENTRY_KEYS+=(\"GOOGLE_ANALYTICS_IDFV_COLLECTION_ENABLED\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_ANALYTICS_IDFV_COLLECTION\")\")\n fi\n\n # config.analytics_default_allow_ad_personalization_signals\n _ANALYTICS_PERSONALIZATION=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"analytics_default_allow_ad_personalization_signals\")\n if [[ $_ANALYTICS_PERSONALIZATION ]]; then\n _PLIST_ENTRY_KEYS+=(\"GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_ANALYTICS_PERSONALIZATION\")\")\n fi\n\n # config.analytics_registration_with_ad_network_enabled\n _ANALYTICS_REGISTRATION_WITH_AD_NETWORK=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"google_analytics_registration_with_ad_network_enabled\")\n if [[ $_ANALYTICS_REGISTRATION_WITH_AD_NETWORK ]]; then\n _PLIST_ENTRY_KEYS+=(\"GOOGLE_ANALYTICS_REGISTRATION_WITH_AD_NETWORK_ENABLED\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_ANALYTICS_REGISTRATION_WITH_AD_NETWORK\")\")\n fi\n\n # config.google_analytics_automatic_screen_reporting_enabled\n _ANALYTICS_AUTO_SCREEN_REPORTING=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"google_analytics_automatic_screen_reporting_enabled\")\n if [[ $_ANALYTICS_AUTO_SCREEN_REPORTING ]]; then\n _PLIST_ENTRY_KEYS+=(\"FirebaseAutomaticScreenReportingEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_ANALYTICS_AUTO_SCREEN_REPORTING\")\")\n fi\n\n # config.perf_auto_collection_enabled\n _PERF_AUTO_COLLECTION=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"perf_auto_collection_enabled\")\n if [[ $_PERF_AUTO_COLLECTION ]]; then\n _PLIST_ENTRY_KEYS+=(\"firebase_performance_collection_enabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_PERF_AUTO_COLLECTION\")\")\n fi\n\n # config.perf_collection_deactivated\n _PERF_DEACTIVATED=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"perf_collection_deactivated\")\n if [[ $_PERF_DEACTIVATED ]]; then\n _PLIST_ENTRY_KEYS+=(\"firebase_performance_collection_deactivated\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_PERF_DEACTIVATED\")\")\n fi\n\n # config.messaging_auto_init_enabled\n _MESSAGING_AUTO_INIT=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"messaging_auto_init_enabled\")\n if [[ $_MESSAGING_AUTO_INIT ]]; then\n _PLIST_ENTRY_KEYS+=(\"FirebaseMessagingAutoInitEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_MESSAGING_AUTO_INIT\")\")\n fi\n\n # config.in_app_messaging_auto_colllection_enabled\n _FIAM_AUTO_INIT=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"in_app_messaging_auto_collection_enabled\")\n if [[ $_FIAM_AUTO_INIT ]]; then\n _PLIST_ENTRY_KEYS+=(\"FirebaseInAppMessagingAutomaticDataCollectionEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_FIAM_AUTO_INIT\")\")\n fi\n\n # config.app_check_token_auto_refresh\n _APP_CHECK_TOKEN_AUTO_REFRESH=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"app_check_token_auto_refresh\")\n if [[ $_APP_CHECK_TOKEN_AUTO_REFRESH ]]; then\n _PLIST_ENTRY_KEYS+=(\"FirebaseAppCheckTokenAutoRefreshEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_APP_CHECK_TOKEN_AUTO_REFRESH\")\")\n fi\n\n # config.crashlytics_disable_auto_disabler - undocumented for now - mainly for debugging, document if becomes useful\n _CRASHLYTICS_AUTO_DISABLE_ENABLED=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"crashlytics_disable_auto_disabler\")\n if [[ $_CRASHLYTICS_AUTO_DISABLE_ENABLED == \"true\" ]]; then\n echo \"Disabled Crashlytics auto disabler.\" # do nothing\n else\n _PLIST_ENTRY_KEYS+=(\"FirebaseCrashlyticsCollectionEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"NO\")\n fi\nelse\n _PLIST_ENTRY_KEYS+=(\"firebase_json_raw\")\n _PLIST_ENTRY_TYPES+=(\"string\")\n _PLIST_ENTRY_VALUES+=(\"$_JSON_OUTPUT_BASE64\")\n echo \"warning: A firebase.json file was not found, whilst this file is optional it is recommended to include it to configure firebase services in React Native Firebase.\"\nfi;\n\necho \"info: 2) Injecting Info.plist entries: \"\n\n# Log out the keys we're adding\nfor i in \"${!_PLIST_ENTRY_KEYS[@]}\"; do\n echo \" -> $i) ${_PLIST_ENTRY_KEYS[$i]}\" \"${_PLIST_ENTRY_TYPES[$i]}\" \"${_PLIST_ENTRY_VALUES[$i]}\"\ndone\n\nfor plist in \"${_TARGET_PLIST}\" \"${_DSYM_PLIST}\" ; do\n if [[ -f \"${plist}\" ]]; then\n\n # paths with spaces break the call to setPlistValue. temporarily modify\n # the shell internal field separator variable (IFS), which normally\n # includes spaces, to consist only of line breaks\n oldifs=$IFS\n IFS=\"\n\"\n\n for i in \"${!_PLIST_ENTRY_KEYS[@]}\"; do\n setPlistValue \"${_PLIST_ENTRY_KEYS[$i]}\" \"${_PLIST_ENTRY_TYPES[$i]}\" \"${_PLIST_ENTRY_VALUES[$i]}\" \"${plist}\"\n done\n\n # restore the original internal field separator value\n IFS=$oldifs\n else\n echo \"warning: A Info.plist build output file was not found (${plist})\"\n fi\ndone\n\necho \"info: <- RNFB build script finished\"\n"; - }; FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/app/mobile/ios/Databag/AppDelegate.h b/app/mobile/ios/Databag/AppDelegate.h index 118bb31f..f7d29720 100644 --- a/app/mobile/ios/Databag/AppDelegate.h +++ b/app/mobile/ios/Databag/AppDelegate.h @@ -1,4 +1,3 @@ -#import #import #import #import diff --git a/app/mobile/ios/Databag/AppDelegate.mm b/app/mobile/ios/Databag/AppDelegate.mm index 0dcb0aca..8a29e414 100644 --- a/app/mobile/ios/Databag/AppDelegate.mm +++ b/app/mobile/ios/Databag/AppDelegate.mm @@ -34,7 +34,6 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot"; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [FIRApp configure]; RCTAppSetupPrepareApp(application); RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions]; diff --git a/app/mobile/ios/Podfile.lock b/app/mobile/ios/Podfile.lock index fa2129dd..bda97465 100644 --- a/app/mobile/ios/Podfile.lock +++ b/app/mobile/ios/Podfile.lock @@ -9,6 +9,8 @@ PODS: - ReactCommon - EXConstants (13.2.4): - ExpoModulesCore + - EXErrorRecovery (3.2.0): + - ExpoModulesCore - EXFileSystem (14.1.0): - ExpoModulesCore - EXFont (10.2.0): @@ -31,62 +33,8 @@ PODS: - React-Core (= 0.69.5) - React-jsi (= 0.69.5) - ReactCommon/turbomodule/core (= 0.69.5) - - Firebase/CoreOnly (10.1.0): - - FirebaseCore (= 10.1.0) - - Firebase/Messaging (10.1.0): - - Firebase/CoreOnly - - FirebaseMessaging (~> 10.1.0) - - FirebaseCore (10.1.0): - - FirebaseCoreInternal (~> 10.0) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/Logger (~> 7.8) - - FirebaseCoreExtension (10.1.0): - - FirebaseCore (~> 10.0) - - FirebaseCoreInternal (10.1.0): - - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseInstallations (10.1.0): - - FirebaseCore (~> 10.0) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/UserDefaults (~> 7.8) - - PromisesObjC (~> 2.1) - - FirebaseMessaging (10.1.0): - - FirebaseCore (~> 10.0) - - FirebaseInstallations (~> 10.0) - - GoogleDataTransport (~> 9.2) - - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/Reachability (~> 7.8) - - GoogleUtilities/UserDefaults (~> 7.8) - - nanopb (< 2.30910.0, >= 2.30908.0) - fmt (6.2.1) - glog (0.3.5) - - GoogleDataTransport (9.2.0): - - GoogleUtilities/Environment (~> 7.7) - - nanopb (< 2.30910.0, >= 2.30908.0) - - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/AppDelegateSwizzler (7.8.0): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Environment (7.8.0): - - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Logger (7.8.0): - - GoogleUtilities/Environment - - GoogleUtilities/Network (7.8.0): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (7.8.0)" - - GoogleUtilities/Reachability (7.8.0): - - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (7.8.0): - - GoogleUtilities/Logger - - nanopb (2.30909.0): - - nanopb/decode (= 2.30909.0) - - nanopb/encode (= 2.30909.0) - - nanopb/decode (2.30909.0) - - nanopb/encode (2.30909.0) - - PromisesObjC (2.1.1) - RCT-Folly (2021.06.28.00-v2): - boost - DoubleConversion @@ -414,14 +362,6 @@ PODS: - React-Core - RNDeviceInfo (10.3.0): - React-Core - - RNFBApp (16.4.3): - - Firebase/CoreOnly (= 10.1.0) - - React-Core - - RNFBMessaging (16.4.3): - - Firebase/Messaging (= 10.1.0) - - FirebaseCoreExtension (= 10.1.0) - - React-Core - - RNFBApp - RNGestureHandler (2.7.0): - React-Core - RNImageCropPicker (0.38.0): @@ -474,6 +414,7 @@ DEPENDENCIES: - EXApplication (from `../node_modules/expo-application/ios`) - EXAV (from `../node_modules/expo-av/ios`) - EXConstants (from `../node_modules/expo-constants/ios`) + - EXErrorRecovery (from `../node_modules/expo-error-recovery/ios`) - EXFileSystem (from `../node_modules/expo-file-system/ios`) - EXFont (from `../node_modules/expo-font/ios`) - Expo (from `../node_modules/expo`) @@ -517,8 +458,6 @@ DEPENDENCIES: - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - RNDeviceInfo (from `../node_modules/react-native-device-info`) - - "RNFBApp (from `../node_modules/@react-native-firebase/app`)" - - "RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`)" - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`) - RNReanimated (from `../node_modules/react-native-reanimated`) @@ -528,17 +467,7 @@ DEPENDENCIES: SPEC REPOS: trunk: - - Firebase - - FirebaseCore - - FirebaseCoreExtension - - FirebaseCoreInternal - - FirebaseInstallations - - FirebaseMessaging - fmt - - GoogleDataTransport - - GoogleUtilities - - nanopb - - PromisesObjC - TOCropViewController EXTERNAL SOURCES: @@ -552,6 +481,8 @@ EXTERNAL SOURCES: :path: "../node_modules/expo-av/ios" EXConstants: :path: "../node_modules/expo-constants/ios" + EXErrorRecovery: + :path: "../node_modules/expo-error-recovery/ios" EXFileSystem: :path: "../node_modules/expo-file-system/ios" EXFont: @@ -636,10 +567,6 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-clipboard/clipboard" RNDeviceInfo: :path: "../node_modules/react-native-device-info" - RNFBApp: - :path: "../node_modules/@react-native-firebase/app" - RNFBMessaging: - :path: "../node_modules/@react-native-firebase/messaging" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" RNImageCropPicker: @@ -659,6 +586,7 @@ SPEC CHECKSUMS: EXApplication: e418d737a036e788510f2c4ad6c10a7d54d18586 EXAV: 596506c9bee54ad52f2f3b625cdaeb9d9f2dd6b7 EXConstants: 7c44785d41d8e959d527d23d29444277a4d1ee73 + EXErrorRecovery: 74d71ee59f6814315457b09d68e86aa95cc7d05d EXFileSystem: 927e0a8885aa9c49e50fc38eaba2c2389f2f1019 EXFont: a5d80bd9b3452b2d5abbce2487da89b0150e6487 Expo: fcdb32274e2ca9c7638d3b21b30fb665c6869219 @@ -667,18 +595,8 @@ SPEC CHECKSUMS: EXSplashScreen: 799bece80089219b2c989c1082d70f3b00995cda FBLazyVector: 0045cf98ca4a48af3bf7108d85b1c243740fa289 FBReactNativeSpec: 82e74141263f8c962e288f5cd6b5d149cdc8afe1 - Firebase: 444b35a9c568a516666213c2f6cccd10cb12559f - FirebaseCore: 55e7ae35991ccca4db03ff8d8df6ed5f17a3e4c7 - FirebaseCoreExtension: 69b966c399abc4ca6dc75006ab87160f81512725 - FirebaseCoreInternal: 96d75228e10fd369564da51bd898414eb0f54df5 - FirebaseInstallations: 99d24bac0243cf8b0e96cf5426340d211f0bcc80 - FirebaseMessaging: 4487bbff9b9b927ba1dd3ea40d1ceb58e4ee3cb5 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a - GoogleDataTransport: 1c8145da7117bd68bbbed00cf304edb6a24de00f - GoogleUtilities: 1d20a6ad97ef46f67bbdec158ce00563a671ebb7 - nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431 - PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a RCTRequired: 85c60c4bde8241278be2c93420de4c65475a2151 RCTTypeSafety: 15990f289215eb0fc65c5eb6e2610faeeda8d5e1 @@ -712,8 +630,6 @@ SPEC CHECKSUMS: ReactCommon: ab1003b81be740fecd82509c370a45b1a7dda0c1 RNCClipboard: 2834e1c4af68697089cdd455ee4a4cdd198fa7dd RNDeviceInfo: 4701f0bf2a06b34654745053db0ce4cb0c53ada7 - RNFBApp: e2157f61e4769b53641df8948c534580630cb50a - RNFBMessaging: 00da9a5a7136caa61a7b75d87e1dd83864251136 RNGestureHandler: 7673697e7c0e9391adefae4faa087442bc04af33 RNImageCropPicker: ffbba608264885c241cbf3a8f78eb7aeeb978241 RNReanimated: 7faa787e8d4493fbc95fab2ad331fa7625828cfa diff --git a/app/mobile/src/context/useAppContext.hook.js b/app/mobile/src/context/useAppContext.hook.js index b6069321..a2503a2c 100644 --- a/app/mobile/src/context/useAppContext.hook.js +++ b/app/mobile/src/context/useAppContext.hook.js @@ -80,33 +80,21 @@ export function useAppContext() { const access = await setLogin(username, server, password, getApplicationName(), getVersion(), getDeviceId(), state.deviceToken, notifications) await store.actions.setSession({ ...access, server}); await setSession({ ...access, server }); - if (access.pushSupported) { - messaging().requestPermission().then(status => {}) - } }, access: async (server, token) => { const access = await setAccountAccess(server, token, getApplicationName(), getVersion(), getDeviceId(), state.deviceToken, notifications); await store.actions.setSession({ ...access, server}); await setSession({ ...access, server }); - if (access.pushSupported) { - messaging().requestPermission().then(status => {}) - } }, login: async (username, password) => { const acc = username.split('@'); const access = await setLogin(acc[0], acc[1], password, getApplicationName(), getVersion(), getDeviceId(), state.deviceToken, notifications) await store.actions.setSession({ ...access, server: acc[1]}); await setSession({ ...access, server: acc[1] }); - if (access.pushSupported) { - messaging().requestPermission().then(status => {}) - } }, logout: async () => { updateState({ loggingOut: true }); try { - await messaging().deleteToken(); - const token = await messaging().getToken(); - updateState({ deviceToken: token }); await clearLogin(state.server, state.appToken); } catch (err) { diff --git a/app/mobile/src/context/useStoreContext.hook.js b/app/mobile/src/context/useStoreContext.hook.js index 0ffacff6..5108133d 100644 --- a/app/mobile/src/context/useStoreContext.hook.js +++ b/app/mobile/src/context/useStoreContext.hook.js @@ -1,7 +1,7 @@ import { useEffect, useState, useRef, useContext } from 'react'; import SQLite from "react-native-sqlite-storage"; -const DATABAG_DB = 'db_v090.db'; +const DATABAG_DB = 'db_v091.db'; export function useStoreContext() { const [state, setState] = useState({});