From 0832f2c031de071d37affce445f62759110b83f4 Mon Sep 17 00:00:00 2001 From: "shreya.mishra" Date: Sun, 18 Aug 2024 17:02:07 +0530 Subject: [PATCH 01/23] updated the way we notify locally --- App.tsx | 1 - android/app/build.gradle | 4 +- android/app/google-services.json | 98 +++ android/app/src/main/AndroidManifest.xml | 31 + android/app/src/main/res/values/colors.xml | 3 + android/build.gradle | 1 + index.js | 3 + package.json | 3 + src/actions/LocalNotification.ts | 22 + src/actions/RemoteNotification.tsx | 71 +++ src/screens/NotifyScreen/NotifyScreen.tsx | 35 +- yarn.lock | 662 ++++++++++++++++++++- 12 files changed, 919 insertions(+), 15 deletions(-) create mode 100644 android/app/google-services.json create mode 100644 android/app/src/main/res/values/colors.xml create mode 100644 src/actions/LocalNotification.ts create mode 100644 src/actions/RemoteNotification.tsx diff --git a/App.tsx b/App.tsx index ff648bd0..c6a6e882 100644 --- a/App.tsx +++ b/App.tsx @@ -14,7 +14,6 @@ export const store = compose(applyMiddleware(...middleware))(createStore)( reducers, ); sagaMiddleware.run(rootSaga); - const App = () => { return ( <> diff --git a/android/app/build.gradle b/android/app/build.gradle index 89dae967..e2cc5587 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: "com.android.application" apply plugin: "org.jetbrains.kotlin.android" apply plugin: "com.facebook.react" - +apply plugin: 'com.google.gms.google-services' /** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need. @@ -67,6 +67,8 @@ android { dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") + implementation(platform("com.google.firebase:firebase-bom:33.1.2")) + implementation("com.google.firebase:firebase-analytics") if (hermesEnabled.toBoolean()) { implementation("com.facebook.react:hermes-android") diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 00000000..150656f3 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,98 @@ +{ + "project_info": { + "project_number": "260594870079", + "firebase_url": "https://rds-backend-86606-default-rtdb.firebaseio.com", + "project_id": "rds-backend-86606", + "storage_bucket": "rds-backend-86606.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:260594870079:android:96f715af50676f7a53958a", + "android_client_info": { + "package_name": "com.notifyapp" + } + }, + "oauth_client": [ + { + "client_id": "260594870079-jk3ak4lbadk26m6hlh16gi1rk4kd7nmb.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBB8iJ4Oi-WD9Ps3tBIipoy9yL4sgesh24" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "260594870079-jk3ak4lbadk26m6hlh16gi1rk4kd7nmb.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:260594870079:android:0d0291fc2c87387053958a", + "android_client_info": { + "package_name": "com.rdsapp" + } + }, + "oauth_client": [ + { + "client_id": "260594870079-jk3ak4lbadk26m6hlh16gi1rk4kd7nmb.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBB8iJ4Oi-WD9Ps3tBIipoy9yL4sgesh24" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "260594870079-jk3ak4lbadk26m6hlh16gi1rk4kd7nmb.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:260594870079:android:bdf1b672dd0f763b53958a", + "android_client_info": { + "package_name": "com.rdsappp" + } + }, + "oauth_client": [ + { + "client_id": "260594870079-jk3ak4lbadk26m6hlh16gi1rk4kd7nmb.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBB8iJ4Oi-WD9Ps3tBIipoy9yL4sgesh24" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "260594870079-jk3ak4lbadk26m6hlh16gi1rk4kd7nmb.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index bc7b2def..3cf3cdbd 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -3,6 +3,8 @@ + + + + + + + + + + + + + + + + + + + + + + #FFF + diff --git a/android/build.gradle b/android/build.gradle index cda1bfd9..561c04cc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -16,6 +16,7 @@ buildscript { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") + classpath("com.google.gms:google-services:4.3.15") } } diff --git a/index.js b/index.js index 9b739329..4a2e2cfd 100644 --- a/index.js +++ b/index.js @@ -5,5 +5,8 @@ import { AppRegistry } from 'react-native'; import App from './App'; import { name as appName } from './app.json'; +import firebase from '@react-native-firebase/app'; + +firebase.initializeApp(); AppRegistry.registerComponent(appName, () => App); diff --git a/package.json b/package.json index 1100385e..f0c8b765 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@react-native-async-storage/async-storage": "^1.15.16", "@react-native-community/netinfo": "^5.9.9", "@react-native-community/slider": "^4.4.3", + "@react-native-firebase/app": "^20.4.0", "@react-native-masked-view/masked-view": "^0.2.6", "@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/drawer": "^6.1.8", @@ -53,6 +54,7 @@ "react-native-pager-view": "^6.2.1", "react-native-paper": "^5.11.2", "react-native-progress": "^5.0.1", + "react-native-push-notification": "^8.1.1", "react-native-radio-buttons-group": "^2.2.11", "react-native-reanimated": "^3.9.0-rc.1", "react-native-safe-area-context": "^3.2.0", @@ -84,6 +86,7 @@ "@types/react": "^18.2.6", "@types/react-native": "^0.66.4", "@types/react-native-datepicker": "^1.7.1", + "@types/react-native-push-notification": "^8.1.4", "@types/react-test-renderer": "^18.0.0", "@typescript-eslint/eslint-plugin": "^5.7.0", "@typescript-eslint/parser": "^5.7.0", diff --git a/src/actions/LocalNotification.ts b/src/actions/LocalNotification.ts new file mode 100644 index 00000000..7e574c4c --- /dev/null +++ b/src/actions/LocalNotification.ts @@ -0,0 +1,22 @@ +import PushNotification from 'react-native-push-notification'; + +const LocalNotification = () => { + const key = Date.now().toString(); // Key must be unique everytime + PushNotification.createChannel( + { + channelId: key, // (required) + channelName: 'Local messasge', // (required) + channelDescription: 'Notification for Local message', // (optional) default: undefined. + importance: 4, // (optional) default: 4. Int value of the Android notification importance + vibrate: true, // (optional) default: true. Creates the default vibration patten if true. + }, + (created) => console.log(`createChannel returned '${created}'`), // (optional) callback returns whether the channel was created, false means it already existed. + ); + PushNotification.localNotification({ + channelId: key, //this must be same with channelid in createchannel + title: 'Local Message', + message: 'Local message !!', + }); +}; + +export default LocalNotification; diff --git a/src/actions/RemoteNotification.tsx b/src/actions/RemoteNotification.tsx new file mode 100644 index 00000000..ee5d40eb --- /dev/null +++ b/src/actions/RemoteNotification.tsx @@ -0,0 +1,71 @@ +import { useEffect } from 'react'; +import { PermissionsAndroid, Platform } from 'react-native'; +import PushNotification from 'react-native-push-notification'; + +const checkApplicationPermission = async () => { + if (Platform.OS === 'android') { + try { + await PermissionsAndroid.request( + PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS, + ); + } catch (error) { + console.error(error); + } + } +}; + +const RemoteNotification = () => { + useEffect(() => { + checkApplicationPermission(); + // Using this function as we are rendering local notification so without this function we will receive multiple notification for same notification + // We have same channelID for every FCM test server notification. + PushNotification.getChannels(function (channel_ids) { + channel_ids.forEach((id) => { + PushNotification.deleteChannel(id); + }); + }); + PushNotification.configure({ + // (optional) Called when Token is generated (iOS and Android) + onRegister: function (token) { + console.log('TOKEN:', token); + }, + + // (required) Called when a remote or local notification is opened or received + onNotification: function (notification) { + const { message, title, id } = notification; + let strTitle: string = JSON.stringify(title).split('"').join(''); + let strBody: string = JSON.stringify(message).split('"').join(''); + const key: string = JSON.stringify(id).split('"').join(''); + PushNotification.createChannel( + { + channelId: key, // (required & must be unique) + channelName: 'remote messasge', // (required) + channelDescription: 'Notification for remote message', // (optional) default: undefined. + importance: 4, // (optional) default: 4. Int value of the Android notification importance + vibrate: true, // (optional) default: true. Creates the default vibration patten if true. + }, + (created) => console.log(`createChannel returned '${created}'`), // (optional) callback returns whether the channel was created, false means it already existed. + ); + PushNotification.localNotification({ + channelId: key, //this must be same with channelId in createchannel + title: strTitle, + message: strBody, + }); + console.log( + 'REMOTE NOTIFICATION ==>', + title, + message, + id, + notification, + ); + // process the notification here + }, + // Android only: GCM or FCM Sender ID + senderID: '1234567890', + popInitialNotification: true, + requestPermissions: true, + }); + }, []); + return null; +}; +export default RemoteNotification; diff --git a/src/screens/NotifyScreen/NotifyScreen.tsx b/src/screens/NotifyScreen/NotifyScreen.tsx index 626c7a91..87d1de5b 100644 --- a/src/screens/NotifyScreen/NotifyScreen.tsx +++ b/src/screens/NotifyScreen/NotifyScreen.tsx @@ -1,20 +1,35 @@ -import { StyleSheet, View } from 'react-native'; +import { StyleSheet, Text, View } from 'react-native'; import React from 'react'; import NotifyButton from '../../components/Notify/NotifyButton'; import Colors from '../../constants/colors/Colors'; +import LocalNotification from '../../actions/LocalNotification'; +import RemoteNotification from '../../actions/RemoteNotification'; const NotifyScreen = () => { - const onNotifyHandler = () => { - console.log('notify'); - }; + // const onNotifyHandler = () => { + // console.log('notify'); + // }; return ( - + + + Push Notification!! + + + ); }; diff --git a/yarn.lock b/yarn.lock index ab52b787..15139e49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1472,6 +1472,413 @@ resolved "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== +"@fastify/busboy@^2.0.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" + integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== + +"@firebase/analytics-compat@0.2.10": + version "0.2.10" + resolved "https://registry.yarnpkg.com/@firebase/analytics-compat/-/analytics-compat-0.2.10.tgz#c98005075c019eb8255764a5279f0ff86b36b863" + integrity sha512-ia68RcLQLLMFWrM10JfmFod7eJGwqr4/uyrtzHpTDnxGX/6gNCBTOuxdAbyWIqXI5XmcMQdz9hDijGKOHgDfPw== + dependencies: + "@firebase/analytics" "0.10.4" + "@firebase/analytics-types" "0.8.2" + "@firebase/component" "0.6.7" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/analytics-types@0.8.2": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@firebase/analytics-types/-/analytics-types-0.8.2.tgz#947f85346e404332aac6c996d71fd4a89cd7f87a" + integrity sha512-EnzNNLh+9/sJsimsA/FGqzakmrAUKLeJvjRHlg8df1f97NLUlFidk9600y0ZgWOp3CAxn6Hjtk+08tixlUOWyw== + +"@firebase/analytics@0.10.4": + version "0.10.4" + resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.10.4.tgz#dc68a86774f9ee4f980708e824157617fd2b8ef7" + integrity sha512-OJEl/8Oye/k+vJ1zV/1L6eGpc1XzAj+WG2TPznJ7PszL7sOFLBXkL9IjHfOCGDGpXeO3btozy/cYUqv4zgNeHg== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/installations" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/app-check-compat@0.3.11": + version "0.3.11" + resolved "https://registry.yarnpkg.com/@firebase/app-check-compat/-/app-check-compat-0.3.11.tgz#0a5d1c72c91ba239e4dabf6fd698b27f082030ca" + integrity sha512-t01zaH3RJpKEey0nGduz3Is+uSz7Sj4U5nwOV6lWb+86s5xtxpIvBJzu/lKxJfYyfZ29eJwpdjEgT1/lm4iQyA== + dependencies: + "@firebase/app-check" "0.8.4" + "@firebase/app-check-types" "0.5.2" + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/app-check-interop-types@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.2.tgz#455b6562c7a3de3ef75ea51f72dfec5829ad6997" + integrity sha512-LMs47Vinv2HBMZi49C09dJxp0QT5LwDzFaVGf/+ITHe3BlIhUiLNttkATSXplc89A2lAaeTqjgqVkiRfUGyQiQ== + +"@firebase/app-check-types@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@firebase/app-check-types/-/app-check-types-0.5.2.tgz#1221bd09b471e11bb149252f16640a0a51043cbc" + integrity sha512-FSOEzTzL5bLUbD2co3Zut46iyPWML6xc4x+78TeaXMSuJap5QObfb+rVvZJtla3asN4RwU7elaQaduP+HFizDA== + +"@firebase/app-check@0.8.4": + version "0.8.4" + resolved "https://registry.yarnpkg.com/@firebase/app-check/-/app-check-0.8.4.tgz#1c965d34527d1b924fc7bd51789119b3f817bf94" + integrity sha512-2tjRDaxcM5G7BEpytiDcIl+NovV99q8yEqRMKDbn4J4i/XjjuThuB4S+4PkmTnZiCbdLXQiBhkVxNlUDcfog5Q== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/app-compat@0.2.35": + version "0.2.35" + resolved "https://registry.yarnpkg.com/@firebase/app-compat/-/app-compat-0.2.35.tgz#ca918736e6b06bdd63eaed24ba213059ecd55f88" + integrity sha512-vgay/WRjeH0r97/Q6L6df2CMx7oyNFDsE5yPQ9oR1G+zx2eT0s8vNNh0WlKqQxUEWaOLRnXhQ8gy7uu0cBgTRg== + dependencies: + "@firebase/app" "0.10.5" + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/app-types@0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.9.2.tgz#8cbcceba784753a7c0066a4809bc22f93adee080" + integrity sha512-oMEZ1TDlBz479lmABwWsWjzHwheQKiAgnuKxE0pz0IXCVx7/rtlkx1fQ6GfgK24WCrxDKMplZrT50Kh04iMbXQ== + +"@firebase/app@0.10.5": + version "0.10.5" + resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.10.5.tgz#84d3c99b253366844335a411b568dd258800c794" + integrity sha512-iY/fNot+hWPk9sTX8aHMqlcX9ynRvpGkskWAdUZ2eQQdLo8d1hSFYcYNwPv0Q/frGMasw8udKWMcFOEpC9fG8g== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + idb "7.1.1" + tslib "^2.1.0" + +"@firebase/auth-compat@0.5.9": + version "0.5.9" + resolved "https://registry.yarnpkg.com/@firebase/auth-compat/-/auth-compat-0.5.9.tgz#ab925dbe8baf0911fb4836c14403706132d751e8" + integrity sha512-RX8Zh/3zz2CsVbmYfgHkfUm4fAEPCl+KHVIImNygV5jTGDF6oKOhBIpf4Yigclyu8ESQKZ4elyN0MBYm9/7zGw== + dependencies: + "@firebase/auth" "1.7.4" + "@firebase/auth-types" "0.12.2" + "@firebase/component" "0.6.7" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + undici "5.28.4" + +"@firebase/auth-interop-types@0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@firebase/auth-interop-types/-/auth-interop-types-0.2.3.tgz#927f1f2139a680b55fef0bddbff2c982b08587e8" + integrity sha512-Fc9wuJGgxoxQeavybiuwgyi+0rssr76b+nHpj+eGhXFYAdudMWyfBHvFL/I5fEHniUM/UQdFzi9VXJK2iZF7FQ== + +"@firebase/auth-types@0.12.2": + version "0.12.2" + resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.12.2.tgz#f12d890585866e53b6ab18b16fa4d425c52eee6e" + integrity sha512-qsEBaRMoGvHO10unlDJhaKSuPn4pyoTtlQuP1ghZfzB6rNQPuhp/N/DcFZxm9i4v0SogjCbf9reWupwIvfmH6w== + +"@firebase/auth@1.7.4": + version "1.7.4" + resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-1.7.4.tgz#0dc8083314a61598c91cfe00cb96cf2cb3d74336" + integrity sha512-d2Fw17s5QesojwebrA903el20Li9/YGgkoOGJjagM4I1qAT36APa/FcZ+OX86KxbYKCtQKTMqraU8pxG7C2JWA== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + undici "5.28.4" + +"@firebase/component@0.6.7": + version "0.6.7" + resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.6.7.tgz#6fbffddb26833e1ed58bf296ad587cb330aee716" + integrity sha512-baH1AA5zxfaz4O8w0vDwETByrKTQqB5CDjRls79Sa4eAGAoERw4Tnung7XbMl3jbJ4B/dmmtsMrdki0KikwDYA== + dependencies: + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/database-compat@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@firebase/database-compat/-/database-compat-1.0.5.tgz#18c2314f169942ac315e46b68f86cbe64bafe063" + integrity sha512-NDSMaDjQ+TZEMDMmzJwlTL05kh1+0Y84C+kVMaOmNOzRGRM7VHi29I6YUhCetXH+/b1Wh4ZZRyp1CuWkd8s6hg== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/database" "1.0.5" + "@firebase/database-types" "1.0.3" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/database-types@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-1.0.3.tgz#1b764212dce88eca74b16da9d220cfea6814858e" + integrity sha512-39V/Riv2R3O/aUjYKh0xypj7NTNXNAK1bcgY5Kx+hdQPRS/aPTS8/5c0CGFYKgVuFbYlnlnhrCTYsh2uNhGwzA== + dependencies: + "@firebase/app-types" "0.9.2" + "@firebase/util" "1.9.6" + +"@firebase/database@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@firebase/database/-/database-1.0.5.tgz#09d7162b7dbc4533f17498ac6a76d5e757ab45be" + integrity sha512-cAfwBqMQuW6HbhwI3Cb/gDqZg7aR0OmaJ85WUxlnoYW2Tm4eR0hFl5FEijI3/gYPUiUcUPQvTkGV222VkT7KPw== + dependencies: + "@firebase/app-check-interop-types" "0.3.2" + "@firebase/auth-interop-types" "0.2.3" + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + faye-websocket "0.11.4" + tslib "^2.1.0" + +"@firebase/firestore-compat@0.3.32": + version "0.3.32" + resolved "https://registry.yarnpkg.com/@firebase/firestore-compat/-/firestore-compat-0.3.32.tgz#1357ba5f80b83f33210d4fb49a1cd346cf95b291" + integrity sha512-at71mwK7a/mUXH0OgyY0+gUzedm/EUydDFYSFsBoO8DYowZ23Mgd6P4Rzq/Ll3zI/3xJN7LGe7Qp4iE/V/3Arg== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/firestore" "4.6.3" + "@firebase/firestore-types" "3.0.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/firestore-types@3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-3.0.2.tgz#75c301acc5fa33943eaaa9570b963c55398cad2a" + integrity sha512-wp1A+t5rI2Qc/2q7r2ZpjUXkRVPtGMd6zCLsiWurjsQpqPgFin3AhNibKcIzoF2rnToNa/XYtyWXuifjOOwDgg== + +"@firebase/firestore@4.6.3": + version "4.6.3" + resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-4.6.3.tgz#87ad38dfd0a0f16e79682177102ee1328d59af44" + integrity sha512-d/+N2iUsiJ/Dc7fApdpdmmTXzwuTCromsdA1lKwYfZtMIOd1fI881NSLwK2wV4I38wkLnvfKJUV6WpU1f3/ONg== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + "@firebase/webchannel-wrapper" "1.0.0" + "@grpc/grpc-js" "~1.9.0" + "@grpc/proto-loader" "^0.7.8" + tslib "^2.1.0" + undici "5.28.4" + +"@firebase/functions-compat@0.3.11": + version "0.3.11" + resolved "https://registry.yarnpkg.com/@firebase/functions-compat/-/functions-compat-0.3.11.tgz#9fdff8b174879b404501df7b8b519e5fb6d0b8ec" + integrity sha512-Qn+ts/M6Lj2/6i1cp5V5TRR+Hi9kyXyHbo+w9GguINJ87zxrCe6ulx3TI5AGQkoQa8YFHUhT3DMGmLFiJjWTSQ== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/functions" "0.11.5" + "@firebase/functions-types" "0.6.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/functions-types@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.6.2.tgz#03b4ec9259d2f57548a3909d6a35ae35ad243552" + integrity sha512-0KiJ9lZ28nS2iJJvimpY4nNccV21rkQyor5Iheu/nq8aKXJqtJdeSlZDspjPSBBiHRzo7/GMUttegnsEITqR+w== + +"@firebase/functions@0.11.5": + version "0.11.5" + resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.11.5.tgz#e4187ae3ae262b0482114f7ad418600ca84f3459" + integrity sha512-qrHJ+l62mZiU5UZiVi84t/iLXZlhRuSvBQsa2qvNLgPsEWR7wdpWhRmVdB7AU8ndkSHJjGlMICqrVnz47sgU7Q== + dependencies: + "@firebase/app-check-interop-types" "0.3.2" + "@firebase/auth-interop-types" "0.2.3" + "@firebase/component" "0.6.7" + "@firebase/messaging-interop-types" "0.2.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + undici "5.28.4" + +"@firebase/installations-compat@0.2.7": + version "0.2.7" + resolved "https://registry.yarnpkg.com/@firebase/installations-compat/-/installations-compat-0.2.7.tgz#c430f34bfcfc008c92ca32fd11d6c84ab5dd7888" + integrity sha512-RPcbD+3nqHbnhVjIOpWK2H5qzZ8pAAAScceiWph0VNTqpKyPQ5tDcp4V5fS0ELpfgsHYvroMLDKfeHxpfvm8cw== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/installations" "0.6.7" + "@firebase/installations-types" "0.5.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/installations-types@0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@firebase/installations-types/-/installations-types-0.5.2.tgz#4d4949e0e83ced7f36cbee009355cd305a36e158" + integrity sha512-que84TqGRZJpJKHBlF2pkvc1YcXrtEDOVGiDjovP/a3s6W4nlbohGXEsBJo0JCeeg/UG9A+DEZVDUV9GpklUzA== + +"@firebase/installations@0.6.7": + version "0.6.7" + resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.6.7.tgz#4fc60ca86e838d7c45dfd1d4926d000060bd1079" + integrity sha512-i6iGoXRu5mX4rTsiMSSKrgh9pSEzD4hwBEzRh5kEhOTr8xN/wvQcCPZDSMVYKwM2XyCPBLVq0JzjyerwL0Rihg== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/util" "1.9.6" + idb "7.1.1" + tslib "^2.1.0" + +"@firebase/logger@0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.4.2.tgz#74dfcfeedee810deb8a7080d5b7eba56aa16ffa2" + integrity sha512-Q1VuA5M1Gjqrwom6I6NUU4lQXdo9IAQieXlujeHZWvRt1b7qQ0KwBaNAjgxG27jgF9/mUwsNmO8ptBCGVYhB0A== + dependencies: + tslib "^2.1.0" + +"@firebase/messaging-compat@0.2.9": + version "0.2.9" + resolved "https://registry.yarnpkg.com/@firebase/messaging-compat/-/messaging-compat-0.2.9.tgz#a4cae54c9caf10a3a6c811152d5bd58f165337b7" + integrity sha512-5jN6wyhwPgBH02zOtmmoOeyfsmoD7ty48D1m0vVPsFg55RqN2Z3Q9gkZ5GmPklFPjTPLcxB1ObcHOZvThTkm7g== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/messaging" "0.12.9" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/messaging-interop-types@0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.2.tgz#81042f7e9739733fa4571d17f6eb6869522754d0" + integrity sha512-l68HXbuD2PPzDUOFb3aG+nZj5KA3INcPwlocwLZOzPp9rFM9yeuI9YLl6DQfguTX5eAGxO0doTR+rDLDvQb5tA== + +"@firebase/messaging@0.12.9": + version "0.12.9" + resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.12.9.tgz#c3cb7a26a3488161273839bf65237f8c485ba661" + integrity sha512-IH+JJmzbFGZXV3+TDyKdqqKPVfKRqBBg2BfYYOy7cm7J+SwV+uJMe8EnDKYeQLEQhtpwciPfJ3qQXJs2lbxDTw== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/installations" "0.6.7" + "@firebase/messaging-interop-types" "0.2.2" + "@firebase/util" "1.9.6" + idb "7.1.1" + tslib "^2.1.0" + +"@firebase/performance-compat@0.2.7": + version "0.2.7" + resolved "https://registry.yarnpkg.com/@firebase/performance-compat/-/performance-compat-0.2.7.tgz#30e29934326888b164c67e5f3709c3a8e580a8d6" + integrity sha512-cb8ge/5iTstxfIGW+iiY+7l3FtN8gobNh9JSQNZgLC9xmcfBYWEs8IeEWMI6S8T+At0oHc3lv+b2kpRMUWr8zQ== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/performance" "0.6.7" + "@firebase/performance-types" "0.2.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/performance-types@0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@firebase/performance-types/-/performance-types-0.2.2.tgz#7b78cd2ab2310bac89a63348d93e67e01eb06dd7" + integrity sha512-gVq0/lAClVH5STrIdKnHnCo2UcPLjJlDUoEB/tB4KM+hAeHUxWKnpT0nemUPvxZ5nbdY/pybeyMe8Cs29gEcHA== + +"@firebase/performance@0.6.7": + version "0.6.7" + resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.6.7.tgz#7d6c4e5ec61df7369d87fb4a5c0af4e0cedee69b" + integrity sha512-d+Q4ltjdJZqjzcdms5i0UC9KLYX7vKGcygZ+7zHA/Xk+bAbMD2CPU0nWTnlNFWifZWIcXZ/2mAMvaGMW3lypUA== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/installations" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/remote-config-compat@0.2.7": + version "0.2.7" + resolved "https://registry.yarnpkg.com/@firebase/remote-config-compat/-/remote-config-compat-0.2.7.tgz#8a7ac7658a7c9cc29a4ad5884bc224eaae950c38" + integrity sha512-Fq0oneQ4SluLnfr5/HfzRS1TZf1ANj1rWbCCW3+oC98An3nE+sCdp+FSuHsEVNwgMg4Tkwx9Oom2lkKeU+Vn+w== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/remote-config" "0.4.7" + "@firebase/remote-config-types" "0.3.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/remote-config-types@0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@firebase/remote-config-types/-/remote-config-types-0.3.2.tgz#a5d1009c6fd08036c5cd4f28764e3cd694f966d5" + integrity sha512-0BC4+Ud7y2aPTyhXJTMTFfrGGLqdYXrUB9sJVAB8NiqJswDTc4/2qrE/yfUbnQJhbSi6ZaTTBKyG3n1nplssaA== + +"@firebase/remote-config@0.4.7": + version "0.4.7" + resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.4.7.tgz#1afd6f3089e3c66ed6909eb60d0eb1329d27c9ff" + integrity sha512-5oPNrPFLsbsjpq0lUEIXoDF2eJK7vAbyXe/DEuZQxnwJlfR7aQbtUlEkRgQWcicXpyDmAmDLo7q7lDbCYa6CpA== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/installations" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/storage-compat@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@firebase/storage-compat/-/storage-compat-0.3.8.tgz#0d6d66a683713953b2bd24494e83bddcbb562f3a" + integrity sha512-qDfY9kMb6Ch2hZb40sBjDQ8YPxbjGOxuT+gU1Z0iIVSSpSX0f4YpGJCypUXiA0T11n6InCXB+T/Dknh2yxVTkg== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/storage" "0.12.5" + "@firebase/storage-types" "0.8.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/storage-types@0.8.2": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@firebase/storage-types/-/storage-types-0.8.2.tgz#edb321b8a3872a9f74e1f27de046f160021c8e1f" + integrity sha512-0vWu99rdey0g53lA7IShoA2Lol1jfnPovzLDUBuon65K7uKG9G+L5uO05brD9pMw+l4HRFw23ah3GwTGpEav6g== + +"@firebase/storage@0.12.5": + version "0.12.5" + resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.12.5.tgz#9277b4f838572ba78f017aa6207c6d7545400846" + integrity sha512-nGWBOGFNr10j0LA4NJ3/Yh3us/lb0Q1xSIKZ38N6FcS+vY54nqJ7k3zE3PENregHC8+8txRow++A568G3v8hOA== + dependencies: + "@firebase/component" "0.6.7" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + undici "5.28.4" + +"@firebase/util@1.9.6": + version "1.9.6" + resolved "https://registry.yarnpkg.com/@firebase/util/-/util-1.9.6.tgz#56dc34e20fcbc0dd07b11b800f95f5d0417cbfb4" + integrity sha512-IBr1MZbp4d5MjBCXL3TW1dK/PDXX4yOGbiwRNh1oAbE/+ci5Uuvy9KIrsFYY80as1I0iOaD5oOMA9Q8j4TJWcw== + dependencies: + tslib "^2.1.0" + +"@firebase/vertexai-preview@0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@firebase/vertexai-preview/-/vertexai-preview-0.0.2.tgz#a17454e4899bf4b3fa07322fb204659e7cfa5868" + integrity sha512-NOOL63kFQRq45ioi5P+hlqj/4LNmvn1URhGjQdvyV54c1Irvoq26aW861PRRLjrSMIeNeiLtCLD5pe+ediepAg== + dependencies: + "@firebase/app-check-interop-types" "0.3.2" + "@firebase/component" "0.6.7" + "@firebase/logger" "0.4.2" + "@firebase/util" "1.9.6" + tslib "^2.1.0" + +"@firebase/webchannel-wrapper@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.0.tgz#a0e11b39fa3ef56ed5333bf321f581037aeda033" + integrity sha512-zuWxyfXNbsKbm96HhXzainONPFqRcoZblQ++e9cAIGUuHfl2cFSBzW01jtesqWG/lqaUyX3H8O1y9oWboGNQBA== + +"@grpc/grpc-js@~1.9.0": + version "1.9.15" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.9.15.tgz#433d7ac19b1754af690ea650ab72190bd700739b" + integrity sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ== + dependencies: + "@grpc/proto-loader" "^0.7.8" + "@types/node" ">=12.12.47" + +"@grpc/proto-loader@^0.7.8": + version "0.7.13" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" + integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw== + dependencies: + lodash.camelcase "^4.3.0" + long "^5.0.0" + protobufjs "^7.2.5" + yargs "^17.7.2" + "@hapi/hoek@^9.0.0": version "9.3.0" resolved "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz" @@ -1802,6 +2209,59 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + "@react-native-async-storage/async-storage@^1.15.16": version "1.19.1" resolved "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.1.tgz" @@ -1998,6 +2458,14 @@ resolved "https://registry.npmjs.org/@react-native-community/slider/-/slider-4.5.0.tgz" integrity sha512-pyUvNTvu5IfCI5abzqRfO/dd3A009RC66RXZE6t0gyOwI/j0QDlq9VZRv3rjkpuIvNTnsYj+m5BHlh0DkSYUyA== +"@react-native-firebase/app@^20.4.0": + version "20.4.0" + resolved "https://registry.yarnpkg.com/@react-native-firebase/app/-/app-20.4.0.tgz#a9c5c12505432d42f7d4a0c4265b8684dc8353fc" + integrity sha512-I3YswH5tq0kSezyFwyV0d3J+lnH+N/SdznFZ70Lr671X0YlrbEBb6BK7FzEiwq8rKeIPh+pbgnbYwzj/k9uEnQ== + dependencies: + firebase "10.12.2" + superstruct "^0.6.2" + "@react-native-masked-view/masked-view@^0.2.6": version "0.2.9" resolved "https://registry.npmjs.org/@react-native-masked-view/masked-view/-/masked-view-0.2.9.tgz" @@ -2592,6 +3060,13 @@ resolved "https://registry.npmjs.org/@types/node/-/node-20.4.8.tgz" integrity sha512-0mHckf6D2DiIAzh8fM8f3HQCvMKDpK94YQ0DSVkfWTG9BZleYIWudw9cJxX8oCk9bM+vAkDyujDV6dmKHbvQpg== +"@types/node@>=12.12.47", "@types/node@>=13.7.0": + version "22.4.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.4.0.tgz#c295fe1d6f5f58916cc61dbef8cf65b5b9b71de9" + integrity sha512-49AbMDwYUz7EXxKU/r7mXOsxwFr4BYbvB7tWYxVuLdb2ibd30ijjXINSMAHiEEZk5PCRBmW1gUeisn2VMKt3cQ== + dependencies: + undici-types "~6.19.2" + "@types/node@^18.0.0": version "18.19.44" resolved "https://registry.npmjs.org/@types/node/-/node-18.19.44.tgz" @@ -2613,6 +3088,11 @@ "@types/react-native" "*" moment ">=2.14.0" +"@types/react-native-push-notification@^8.1.4": + version "8.1.4" + resolved "https://registry.yarnpkg.com/@types/react-native-push-notification/-/react-native-push-notification-8.1.4.tgz#5adcddab82beeac6f1256eeb54160bca1714d080" + integrity sha512-qXu/NcQ7YSk5ZveDMNKFBQkLt9W5FCde3be+h8fYbEnmvd5O+v5m318XGhh8AMPXURAV9pSB5Ads08Wc0KTS7A== + "@types/react-native@*": version "0.72.2" resolved "https://registry.npmjs.org/@types/react-native/-/react-native-0.72.2.tgz" @@ -3567,6 +4047,16 @@ 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.yarnpkg.com/clone-deep/-/clone-deep-2.0.2.tgz#00db3a1e173656730d1188c3d6aced6d7ea97713" + 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" @@ -4614,6 +5104,13 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +faye-websocket@0.11.4: + version "0.11.4" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" + integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== + dependencies: + websocket-driver ">=0.5.1" + fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz" @@ -4703,6 +5200,39 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +firebase@10.12.2: + version "10.12.2" + resolved "https://registry.yarnpkg.com/firebase/-/firebase-10.12.2.tgz#9049286c5fafb6d686bb19ad93c7bb4a9e8756c0" + integrity sha512-ZxEdtSvP1I9su1yf32D8TIdgxtPgxwr6z3jYAR1TXS/t+fVfpoPc/N1/N2bxOco9mNjUoc+od34v5Fn4GeKs6Q== + dependencies: + "@firebase/analytics" "0.10.4" + "@firebase/analytics-compat" "0.2.10" + "@firebase/app" "0.10.5" + "@firebase/app-check" "0.8.4" + "@firebase/app-check-compat" "0.3.11" + "@firebase/app-compat" "0.2.35" + "@firebase/app-types" "0.9.2" + "@firebase/auth" "1.7.4" + "@firebase/auth-compat" "0.5.9" + "@firebase/database" "1.0.5" + "@firebase/database-compat" "1.0.5" + "@firebase/firestore" "4.6.3" + "@firebase/firestore-compat" "0.3.32" + "@firebase/functions" "0.11.5" + "@firebase/functions-compat" "0.3.11" + "@firebase/installations" "0.6.7" + "@firebase/installations-compat" "0.2.7" + "@firebase/messaging" "0.12.9" + "@firebase/messaging-compat" "0.2.9" + "@firebase/performance" "0.6.7" + "@firebase/performance-compat" "0.2.7" + "@firebase/remote-config" "0.4.7" + "@firebase/remote-config-compat" "0.2.7" + "@firebase/storage" "0.12.5" + "@firebase/storage-compat" "0.3.8" + "@firebase/util" "1.9.6" + "@firebase/vertexai-preview" "0.0.2" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" @@ -4738,6 +5268,23 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +for-in@^0.1.3: + version "0.1.8" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1" + integrity sha512-F0to7vbBSHP8E3l6dCjxNOLuSFAACIxFy3UehTUlG7svlXi37HHsDkyVcHo0Pq8QwrE+pXvWSVX3ZT1T9wAZ9g== + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== + +for-own@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" + integrity sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg== + dependencies: + for-in "^1.0.1" + fresh@0.5.2: version "0.5.2" resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz" @@ -5053,11 +5600,21 @@ http-errors@2.0.0: statuses "2.0.1" toidentifier "1.0.1" +http-parser-js@>=0.5.1: + version "0.5.8" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" + integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== + human-signals@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +idb@7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b" + integrity sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ== + ieee754@^1.1.13: version "1.2.1" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" @@ -5219,6 +5776,11 @@ is-docker@^2.0.0: resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" @@ -5976,7 +6538,12 @@ jsonfile@^4.0.0: object.assign "^4.1.4" object.values "^1.1.6" -kind-of@^6.0.2: +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.1, 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== @@ -6034,6 +6601,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" @@ -6076,6 +6648,11 @@ logkitty@^0.7.1: dayjs "^1.8.15" yargs "^15.1.0" +long@^5.0.0: + version "5.2.3" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" @@ -6472,6 +7049,14 @@ minimist@^1.2.6: resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +mixin-object@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mixin-object/-/mixin-object-2.0.1.tgz#4fb949441dab182540f1fe035ba60e1947a5e57e" + integrity sha512-ALGF1Jt9ouehcaXaHhn6t1yGWRqGaHkPFndtFVHfZXOvkIZ/yoGaSi0AHVTafb3ZBGg4dr/bDwnaEKqCXzchMA== + dependencies: + for-in "^0.1.3" + is-extendable "^0.1.1" + mkdirp@^0.5.1: version "0.5.6" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" @@ -7055,6 +7640,24 @@ prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +protobufjs@^7.2.5: + version "7.3.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.3.2.tgz#60f3b7624968868f6f739430cfbc8c9370e26df4" + integrity sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/node" ">=13.7.0" + long "^5.0.0" + punycode@^2.1.0: version "2.3.0" resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" @@ -7291,6 +7894,11 @@ react-native-progress@^5.0.1: dependencies: prop-types "^15.7.2" +react-native-push-notification@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/react-native-push-notification/-/react-native-push-notification-8.1.1.tgz#a41d20c70ea5a7709417e96261b225461f8dc73a" + integrity sha512-XpBtG/w+a6WXTxu6l1dNYyTiHnbgnvjoc3KxPTxYkaIABRmvuJZkFxqruyGvfCw7ELAlZEAJO+dthdTabCe1XA== + react-native-radio-buttons-group@^2.2.11: version "2.3.2" resolved "https://registry.npmjs.org/react-native-radio-buttons-group/-/react-native-radio-buttons-group-2.3.2.tgz" @@ -7736,7 +8344,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@~5.2.0: +safe-buffer@>=5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -7870,6 +8478,15 @@ sha1-file@^1.0.4: resolved "https://registry.npmjs.org/sha1-file/-/sha1-file-1.0.4.tgz" integrity sha512-IgcUYjTck/UAx0wdtBoTwiy4/yiIZX6do4uaqUtryJY/pBOQC1w3Cb/bZMyC2H3QYnodL5vbX0lY69xlWqeBnA== +shallow-clone@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-1.0.0.tgz#4480cd06e882ef68b2ad88a3ea54832e2c48b571" + 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" @@ -8198,6 +8815,14 @@ 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.yarnpkg.com/superstruct/-/superstruct-0.6.2.tgz#c5eb034806a17ff98d036674169ef85e4c7f6a1c" + 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" @@ -8338,6 +8963,11 @@ tslib@^2.0.1, tslib@^2.0.3: resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== +tslib@^2.1.0: + version "2.6.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" + integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== + tsutils@^3.17.1, tsutils@^3.21.0: version "3.21.0" resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz" @@ -8460,6 +9090,18 @@ undici-types@~5.26.4: resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~6.19.2: + version "6.19.6" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.6.tgz#e218c3df0987f4c0e0008ca00d6b6472d9b89b36" + integrity sha512-e/vggGopEfTKSvj4ihnOLTsqhrKRN3LeO6qSN/GxohhuRv8qH9bNQ4B8W7e/vFL+0XTnmHPB4/kegunZGA4Org== + +undici@5.28.4: + version "5.28.4" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" + integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== + dependencies: + "@fastify/busboy" "^2.0.0" + unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" @@ -8583,6 +9225,20 @@ webidl-conversions@^3.0.0: resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +websocket-driver@>=0.5.1: + version "0.7.4" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" + integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== + dependencies: + http-parser-js ">=0.5.1" + safe-buffer ">=5.1.0" + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.4" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" + integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== + whatwg-fetch@^3.0.0: version "3.6.17" resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.17.tgz" @@ -8805,7 +9461,7 @@ yargs@^15.1.0: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^17.3.1, yargs@^17.6.2: +yargs@^17.3.1, yargs@^17.6.2, yargs@^17.7.2: version "17.7.2" resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== From fb23fc660f36cb0ead33774d47eebc235c18af7c Mon Sep 17 00:00:00 2001 From: "shreya.mishra" Date: Sun, 18 Aug 2024 17:04:00 +0530 Subject: [PATCH 02/23] fix ui of notify screen button --- src/screens/NotifyScreen/NotifyScreen.tsx | 25 +++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/screens/NotifyScreen/NotifyScreen.tsx b/src/screens/NotifyScreen/NotifyScreen.tsx index 87d1de5b..c9fdd5c7 100644 --- a/src/screens/NotifyScreen/NotifyScreen.tsx +++ b/src/screens/NotifyScreen/NotifyScreen.tsx @@ -11,25 +11,14 @@ const NotifyScreen = () => { // }; return ( - - - Push Notification!! + - - + ); }; From 48dc277eda791a12877567dbc9b0bc0fabcb3928 Mon Sep 17 00:00:00 2001 From: "shreya.mishra" Date: Mon, 19 Aug 2024 16:09:08 +0530 Subject: [PATCH 03/23] integtrated the notify api --- src/constants/apiConstant/NotifyApi.ts | 3 +++ src/screens/AuthScreen/Util.ts | 19 +++++++++++++ src/screens/NotifyScreen/NotifyScreen.tsx | 33 ++++++++++++++++------- 3 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 src/constants/apiConstant/NotifyApi.ts diff --git a/src/constants/apiConstant/NotifyApi.ts b/src/constants/apiConstant/NotifyApi.ts new file mode 100644 index 00000000..b4cf24f4 --- /dev/null +++ b/src/constants/apiConstant/NotifyApi.ts @@ -0,0 +1,3 @@ +import { PROD_BASE_URL } from './BaseUrl'; + +export const SAVE_FCM_TOKEN = `${PROD_BASE_URL}/v1/fcm-tokens`; diff --git a/src/screens/AuthScreen/Util.ts b/src/screens/AuthScreen/Util.ts index 875856a8..bf666105 100644 --- a/src/screens/AuthScreen/Util.ts +++ b/src/screens/AuthScreen/Util.ts @@ -4,6 +4,7 @@ import { HomeApi } from '../../constants/apiConstant/HomeApi'; import { PermissionsAndroid } from 'react-native'; import moment from 'moment'; import GoalsApi from '../../constants/apiConstant/GoalsApi'; +import { SAVE_FCM_TOKEN } from '../../constants/apiConstant/NotifyApi'; export const getUserData = async (token: string) => { try { @@ -442,3 +443,21 @@ export const overallTaskProgress = async ( console.error('API error:', err); } }; + +export const postFcmToken = async (fcmToken: string, token: string) => { + try { + const response = await axios.post( + SAVE_FCM_TOKEN, + { fcmToken: fcmToken }, + { + headers: { + 'Content-Type': 'application/json', + Cookie: `rds-session=${token}`, + }, + }, + ); + return response.data; + } catch (error) { + throw new Error(`API Error: ${error} - ${error}`); + } +}; diff --git a/src/screens/NotifyScreen/NotifyScreen.tsx b/src/screens/NotifyScreen/NotifyScreen.tsx index c9fdd5c7..8285cdb9 100644 --- a/src/screens/NotifyScreen/NotifyScreen.tsx +++ b/src/screens/NotifyScreen/NotifyScreen.tsx @@ -1,20 +1,35 @@ -import { StyleSheet, Text, View } from 'react-native'; -import React from 'react'; +import { StyleSheet, View } from 'react-native'; +import React, { useContext } from 'react'; import NotifyButton from '../../components/Notify/NotifyButton'; import Colors from '../../constants/colors/Colors'; import LocalNotification from '../../actions/LocalNotification'; import RemoteNotification from '../../actions/RemoteNotification'; +import { firebase } from '@react-native-firebase/messaging'; +import { AuthContext } from '../../context/AuthContext'; +import { postFcmToken } from '../AuthScreen/Util'; +import NotifyForm from '../../components/Notify/NotifyForm'; const NotifyScreen = () => { - // const onNotifyHandler = () => { - // console.log('notify'); - // }; + const { loggedInUserData } = useContext(AuthContext); + + const notifyHandler = () => { + LocalNotification(); + getFCMToken(); + }; + const getFCMToken = async () => { + const fcmToken_ = await firebase.messaging().getToken(); + console.log('🚀 ~ getFCMToken ~ fcmToken_:', fcmToken_); + const token = loggedInUserData?.token; + + await postFcmToken(fcmToken_, token); + }; return ( - - + + + { export default NotifyScreen; const styles = StyleSheet.create({ container: { - padding: 20, + // padding: 20, }, }); From 339b35adef21b49d8bb9f88083738b046fea469f Mon Sep 17 00:00:00 2001 From: "shreya.mishra" Date: Wed, 28 Aug 2024 23:47:46 +0530 Subject: [PATCH 04/23] updated the api and applied on form --- src/components/Notify/NotifyForm.tsx | 246 ++++++++++++++++-- src/constants/apiConstant/BaseUrl.ts | 1 + src/constants/apiConstant/HomeApi.ts | 2 +- src/constants/apiConstant/NotifyApi.ts | 3 +- .../TabNavigation/TabNavigation.tsx | 2 +- src/screens/AuthScreen/Util.ts | 37 ++- src/screens/NotifyScreen/NotifyScreen.tsx | 15 +- 7 files changed, 267 insertions(+), 39 deletions(-) diff --git a/src/components/Notify/NotifyForm.tsx b/src/components/Notify/NotifyForm.tsx index 66eb6c4b..dbc79911 100644 --- a/src/components/Notify/NotifyForm.tsx +++ b/src/components/Notify/NotifyForm.tsx @@ -2,21 +2,72 @@ import { View, Text, TextInput, - Picker, - Button, StyleSheet, + TouchableOpacity, + FlatList, + Image, + Keyboard, } from 'react-native'; -import React, { useState } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; +import { Picker } from '@react-native-picker/picker'; +import Colors from '../../constants/colors/Colors'; +import StyleConfig from '../../utils/StyleConfig'; +import { scale } from '../../utils/utils'; +import { + getAllUsers, + postFcmToken, + sendNotification, +} from '../../screens/AuthScreen/Util'; +import { AuthContext } from '../../context/AuthContext'; +import { firebase } from '@react-native-firebase/messaging'; -const NotifyForm = () => { +const NotifyForm = ({ notifyHandler }: { notifyHandler: () => void }) => { const [title, setTitle] = useState(''); const [description, setDescription] = useState(''); - const [notifyTo, setNotifyTo] = useState(''); + const [isDropDownSelected, setIsDropDownSelected] = useState(false); + const [searchQuery, setSearchQuery] = useState(''); + const [allUsers, setAllUsers] = useState([]); + const [selectedUser, setSelectedUser] = useState(''); + const [isLoading, setIsLoading] = useState(true); + const { loggedInUserData } = useContext(AuthContext); + const token = loggedInUserData?.token; + + const selectDropDown = () => { + Keyboard.dismiss(); + setIsDropDownSelected(!isDropDownSelected); + }; - const handleButtonPress = () => { + const handleDropDownPress = (item: any) => { + setSelectedUser(item); + setIsDropDownSelected(false); + }; + + const getFCMToken = async () => { + const fcmToken_ = await firebase.messaging().getToken(); + console.log('🚀 ~ getFCMToken ~ fcmToken_:', fcmToken_); + + await postFcmToken(fcmToken_, token); + }; + const handleButtonPress = async () => { // Handle the button press and perform necessary actions (e.g., send notification) - console.log('Notification sent:', { title, description, notifyTo }); + + console.log('setSelected User', { + title, + description, + notifyTo: selectedUser?.id, + }); + await sendNotification(title, description, selectedUser?.id, token); + // LocalNotification(); }; + useEffect(() => { + const fetchData = async () => { + const allUser = await getAllUsers(loggedInUserData?.token); + setAllUsers(allUser); + setIsLoading(false); + }; + fetchData(); + getFCMToken(); + }, [loggedInUserData?.token]); return ( Title: @@ -25,6 +76,7 @@ const NotifyForm = () => { value={title} onChangeText={(text) => setTitle(text)} placeholder="Enter title" + placeholderTextColor={'black'} /> Description: @@ -33,41 +85,195 @@ const NotifyForm = () => { value={description} onChangeText={(text) => setDescription(text)} placeholder="Enter description" + placeholderTextColor={'black'} multiline /> Notify To: - setNotifyTo(itemValue)} - > - - - {/* Add more items as needed */} - - -