From 247afc982df5bc8fc43dc8a984dcb18d55daffe9 Mon Sep 17 00:00:00 2001 From: BDA MacMini <> Date: Thu, 4 Dec 2025 13:26:28 +0700 Subject: [PATCH] add lib @notifee/react-native for push notification forground --- App.js | 74 ++++++++++++++-------- ios/Fix.swift | 8 +++ ios/Podfile.lock | 9 +++ ios/csareactrn60-Bridging-Header.h | 4 ++ ios/csareactrn60.xcodeproj/project.pbxproj | 24 +++++-- package.json | 1 + yarn.lock | 20 +++++- 7 files changed, 108 insertions(+), 32 deletions(-) create mode 100644 ios/Fix.swift create mode 100644 ios/csareactrn60-Bridging-Header.h diff --git a/App.js b/App.js index adcf05e..fa99dea 100644 --- a/App.js +++ b/App.js @@ -21,6 +21,7 @@ import Toast from 'react-native-toast-message' import SplashScreen from 'react-native-splash-screen' import { setBaseUrlByServerMode } from './src/api/api' import { Settings } from 'react-native-fbsdk-next'; +import notifee, { AndroidImportance } from '@notifee/react-native'; Text.defaultProps = Text.defaultProps || {} Text.defaultProps.allowFontScaling = false @@ -34,19 +35,24 @@ class App extends Component { constructor(props) { super(props) this._setDataFromInitState = this._setDataFromInitState.bind(this) + this.unsubscribe = null; } componentDidMount = async () => { SplashScreen.hide() Settings.initializeSDK(); - // Test FCM token + await this.requestUserPermission(); + this.unsubscribe = messaging().onMessage(async remoteMessage => { + console.log('A new FCM message arrived!', remoteMessage); + await this.onDisplayNotification(remoteMessage); + }); + try { const token = await messaging().getToken(); console.log('Current FCM Token:', token); console.log('Token length:', token ? token.length : 0); - // ตรวจสอบ permission status const authStatus = await messaging().requestPermission(); console.log('Permission status:', authStatus); @@ -55,33 +61,47 @@ class App extends Component { } } - // เพิ่ม method ใหม่สำหรับ setup listeners - setupNotificationListeners = () => { - // Foreground message handler - messaging().onMessage(async remoteMessage => { - console.log('Foreground notification:', remoteMessage); - }); - - // Background/Quit message handler - messaging().setBackgroundMessageHandler(async remoteMessage => { - console.log('Background notification:', remoteMessage); - }); - - // Notification opened app handler - messaging().onNotificationOpenedApp(remoteMessage => { - console.log('Notification opened app:', remoteMessage); - }); - - // Check if app was opened from notification - messaging() - .getInitialNotification() - .then(remoteMessage => { - if (remoteMessage) { - console.log('App opened from notification:', remoteMessage); - } - }); + componentWillUnmount() { + if (this.unsubscribe) { + this.unsubscribe(); + } } + requestUserPermission = async () => { + const authStatus = await messaging().requestPermission(); + const enabled = + authStatus === messaging.AuthorizationStatus.AUTHORIZED || + authStatus === messaging.AuthorizationStatus.PROVISIONAL; + + if (enabled) { + console.log('Authorization status:', authStatus); + } + }; + + onDisplayNotification = async (remoteMessage) => { + const channelId = await notifee.createChannel({ + id: 'default', + name: 'Default Channel', + importance: AndroidImportance.HIGH, + }); + + await notifee.displayNotification({ + title: remoteMessage.notification.title, + body: remoteMessage.notification.body, + android: { + channelId, + smallIcon: 'ic_launcher' + }, + ios: { + foregroundPresentationOptions: { + badge: true, + sound: true, + banner: true, + }, + }, + }); + }; + initNotification = async () => { try { await this.setPermission() diff --git a/ios/Fix.swift b/ios/Fix.swift new file mode 100644 index 0000000..56002b7 --- /dev/null +++ b/ios/Fix.swift @@ -0,0 +1,8 @@ +// +// Untitled.swift +// csareactrn60 +// +// Created by BDA Office on 4/12/2568 BE. +// Copyright © 2568 BE Facebook. All rights reserved. +// + diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ec02146..8dbac56 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -606,6 +606,11 @@ PODS: - React-Core - React-RCTImage - TOCropViewController + - RNNotifee (7.8.2): + - React-Core + - RNNotifee/NotifeeCore (= 7.8.2) + - RNNotifee/NotifeeCore (7.8.2): + - React-Core - RNPermissions (4.1.5): - React-Core - RNScreens (2.18.1): @@ -687,6 +692,7 @@ DEPENDENCIES: - "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`) + - "RNNotifee (from `../node_modules/@notifee/react-native`)" - RNPermissions (from `../node_modules/react-native-permissions`) - RNScreens (from `../node_modules/react-native-screens`) - RNSVG (from `../node_modules/react-native-svg`) @@ -832,6 +838,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-gesture-handler" RNImageCropPicker: :path: "../node_modules/react-native-image-crop-picker" + RNNotifee: + :path: "../node_modules/@notifee/react-native" RNPermissions: :path: "../node_modules/react-native-permissions" RNScreens: @@ -921,6 +929,7 @@ SPEC CHECKSUMS: RNFBMessaging: c05a432d82a2aa730161e62c56b2a53ca3b412f5 RNGestureHandler: 6572a5f44759900730562b418da289c373de8d06 RNImageCropPicker: 5c7ec5f529a8871ea5aea10c9d721034bdfd6a88 + RNNotifee: 8768d065bf1e2f9f8f347b4bd79147431c7eacd6 RNPermissions: 553c7539c121295b3eb984b8a7dce572a348ccdd RNScreens: 6a2106686e0de9866ab14ca250d7e47a49416b51 RNSVG: af004514150de2bd928e11d215bca33a5d1c19ce diff --git a/ios/csareactrn60-Bridging-Header.h b/ios/csareactrn60-Bridging-Header.h new file mode 100644 index 0000000..1b2cb5d --- /dev/null +++ b/ios/csareactrn60-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/ios/csareactrn60.xcodeproj/project.pbxproj b/ios/csareactrn60.xcodeproj/project.pbxproj index a5eb85f..20ae8b1 100644 --- a/ios/csareactrn60.xcodeproj/project.pbxproj +++ b/ios/csareactrn60.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ 59D523C8F50B4740944768F7 /* HelveticaNeue-BlackExt.otf in Resources */ = {isa = PBXBuildFile; fileRef = 12FFE6B1F22E45B389BE558E /* HelveticaNeue-BlackExt.otf */; }; 6059ACDBE70E4CECA8A06232 /* HelveticaNeueBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5D2BF1F31E004EEE9D522238 /* HelveticaNeueBoldItalic.ttf */; }; 613CD38CE1D34789B42DE436 /* HelveticaNeue-BlackCondObl.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5A12439D9E8543F5BE6EE3D1 /* HelveticaNeue-BlackCondObl.otf */; }; + 61F5D71D2EE145EC00A6507F /* Fix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61F5D71C2EE145DD00A6507F /* Fix.swift */; }; 64317D2EBF034084A3D0E110 /* Prompt-SemiBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5636EF3B5B25467E8C547356 /* Prompt-SemiBoldItalic.ttf */; }; 64D541496C194E35AA212970 /* HelveticaNeueUltraLight.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 73D1933D9D434B94925AEA3D /* HelveticaNeueUltraLight.ttf */; }; 6617BBF9E0FD491FB83BB4CA /* HelveticaNeue-ThinCondObl.otf in Resources */ = {isa = PBXBuildFile; fileRef = F1E91A4685864E6EA1AB8961 /* HelveticaNeue-ThinCondObl.otf */; }; @@ -129,6 +130,8 @@ 5A12439D9E8543F5BE6EE3D1 /* HelveticaNeue-BlackCondObl.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "HelveticaNeue-BlackCondObl.otf"; path = "../assets/fonts/HelveticaNeue/HelveticaNeue-BlackCondObl.otf"; sourceTree = ""; }; 5D2BF1F31E004EEE9D522238 /* HelveticaNeueBoldItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = HelveticaNeueBoldItalic.ttf; path = ../assets/fonts/HelveticaNeue/HelveticaNeueBoldItalic.ttf; sourceTree = ""; }; 5E74820688DD452C826EF9E4 /* HelveticaNeue-BlackCond.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "HelveticaNeue-BlackCond.otf"; path = "../assets/fonts/HelveticaNeue/HelveticaNeue-BlackCond.otf"; sourceTree = ""; }; + 61F5D71C2EE145DD00A6507F /* Fix.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fix.swift; sourceTree = ""; }; + 61F5D71E2EE145FD00A6507F /* csareactrn60-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "csareactrn60-Bridging-Header.h"; sourceTree = ""; }; 6A55B30A897D413385D4D499 /* icomoon.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = icomoon.ttf; path = ../assets/icons/icomoon.ttf; sourceTree = ""; }; 6B1C611BFCF747E2955D2D25 /* Prompt-Black.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Prompt-Black.ttf"; path = "../assets/fonts/Prompt/Prompt-Black.ttf"; sourceTree = ""; }; 6CDCC02C517545A4BB84A7E3 /* HelveticaNeue-HeavyExt.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "HelveticaNeue-HeavyExt.otf"; path = "../assets/fonts/HelveticaNeue/HelveticaNeue-HeavyExt.otf"; sourceTree = ""; }; @@ -322,6 +325,7 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( + 61F5D71C2EE145DD00A6507F /* Fix.swift */, FD7256082D81A1CD00E59CEC /* PrivacyInfo.xcprivacy */, 883370DF23323B1E0045FDA1 /* GoogleService-Info.plist */, 13B07FAE1A68108700A75B9A /* csareactrn60 */, @@ -330,6 +334,7 @@ 2D16E6871FA4F8E400B85C8A /* Frameworks */, A617DCC10EF8CE6D4DD029BF /* Pods */, 4916917C7A3244F890BEE158 /* Resources */, + 61F5D71E2EE145FD00A6507F /* csareactrn60-Bridging-Header.h */, ); indentWidth = 2; sourceTree = ""; @@ -390,6 +395,7 @@ TargetAttributes = { 13B07F861A680F5B00A75B9A = { DevelopmentTeam = 84F3R56BUC; + LastSwiftMigration = 2600; }; }; }; @@ -513,6 +519,8 @@ "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)", ); name = "[CP-User] [RNFB] Core Configuration"; + outputPaths = ( + ); 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"; @@ -661,6 +669,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 61F5D71D2EE145EC00A6507F /* Fix.swift in Sources */, 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, ); @@ -686,17 +695,18 @@ baseConfigurationReference = A4FCADBFE9B149AF00A57491 /* Pods-csareactrn60.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = csareactrn60/csareactrn60.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 6; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = 84F3R56BUC; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 84F3R56BUC; INFOPLIST_FILE = csareactrn60/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 2.111; + MARKETING_VERSION = 2.112; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -706,6 +716,9 @@ PRODUCT_NAME = csareactrn60; PROVISIONING_PROFILE_SPECIFIER = "Csa dev apple id"; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Csa dist apple id"; + SWIFT_OBJC_BRIDGING_HEADER = "csareactrn60-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -716,17 +729,18 @@ baseConfigurationReference = 25116F45562BB5EB09DF23A8 /* Pods-csareactrn60.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = csareactrn60/csareactrn60.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 84F3R56BUC; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 84F3R56BUC; INFOPLIST_FILE = csareactrn60/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 2.111; + MARKETING_VERSION = 2.112; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -736,6 +750,8 @@ PRODUCT_NAME = csareactrn60; PROVISIONING_PROFILE_SPECIFIER = "Csa dist apple id"; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Csa dist apple id"; + SWIFT_OBJC_BRIDGING_HEADER = "csareactrn60-Bridging-Header.h"; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; }; diff --git a/package.json b/package.json index bc0f8fc..fb108b7 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ }, "dependencies": { "@invertase/react-native-apple-authentication": "^1.1.2", + "@notifee/react-native": "7.8.2", "@react-native-async-storage/async-storage": "^2.1.2", "@react-native-camera-roll/camera-roll": "^7.10.0", "@react-native-community/datetimepicker": "^3.0.2", diff --git a/yarn.lock b/yarn.lock index 2402f83..24a1627 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1088,7 +1088,20 @@ "@babel/parser" "^7.27.2" "@babel/types" "^7.27.1" -"@babel/traverse--for-generate-function-map@npm:@babel/traverse@^7.25.3", "@babel/traverse@^7.20.0", "@babel/traverse@^7.25.3", "@babel/traverse@^7.27.1", "@babel/traverse@^7.27.3", "@babel/traverse@^7.28.0": +"@babel/traverse--for-generate-function-map@npm:@babel/traverse@^7.25.3": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.0.tgz#518aa113359b062042379e333db18380b537e34b" + integrity sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg== + dependencies: + "@babel/code-frame" "^7.27.1" + "@babel/generator" "^7.28.0" + "@babel/helper-globals" "^7.28.0" + "@babel/parser" "^7.28.0" + "@babel/template" "^7.27.2" + "@babel/types" "^7.28.0" + debug "^4.3.1" + +"@babel/traverse@^7.20.0", "@babel/traverse@^7.25.3", "@babel/traverse@^7.27.1", "@babel/traverse@^7.27.3", "@babel/traverse@^7.28.0": version "7.28.0" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.0.tgz#518aa113359b062042379e333db18380b537e34b" integrity sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg== @@ -1500,6 +1513,11 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@notifee/react-native@7.8.2": + version "7.8.2" + resolved "https://registry.yarnpkg.com/@notifee/react-native/-/react-native-7.8.2.tgz#72d3199ae830b4128ddaef3c1c2f11604759c9c4" + integrity sha512-VG4IkWJIlOKqXwa3aExC3WFCVCGCC9BA55Ivg0SMRfEs+ruvYy/zlLANcrVGiPtgkUEryXDhA8SXx9+JcO8oLA== + "@react-native-async-storage/async-storage@^1.13.4": version "1.24.0" resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.24.0.tgz#888efbc62a26f7d9464b32f4d3027b7f2771999b"