This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const currentDate = new Date(); | |
| const yyyyMMDDDate = | |
| currentDate.getFullYear() + | |
| "-" + | |
| (currentDate.getMonth() + 1) + | |
| "-" + | |
| currentDate.getDate(); | |
| const hhMMSSTime = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const currentDate = new Date(); | |
| const hhMMSSTime = | |
| currentDate.getHours() + | |
| ":" + | |
| currentDate.getMinutes() + | |
| ":" + | |
| currentDate.getSeconds(); | |
| console.log(hhMMSSTime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const currentDate = new Date(); | |
| const yyyyMMDDDate = | |
| currentDate.getFullYear() + | |
| "-" + | |
| (currentDate.getMonth() + 1) + | |
| "-" + | |
| currentDate.getDate(); | |
| console.log(yyyyMMDDDate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const currentDate = new Date(); | |
| console.log(currentDate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Method: POST | |
| Example Request Body: | |
| { | |
| "email": "[email protected]", | |
| "password": "123456" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <key>NSCameraUsageDescription</key> | |
| <string></string> | |
| <key>NSLocationWhenInUseUsageDescription</key> | |
| <string></string> | |
| <key>NSMicrophoneUsageDescription</key> | |
| <string></string> | |
| <key>NSPhotoLibraryUsageDescription</key> | |
| <string></string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| useEffect(() => { | |
| ... | |
| getPermissions(); | |
| }, []); | |
| ... | |
| const getPermissions = async () => { | |
| if (Platform.OS === 'android') { | |
| let granted = await PermissionsAndroid.requestMultiple([ | |
| PermissionsAndroid.PERMISSIONS.CAMERA, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { fbConfig } from "./env"; | |
| import { initializeApp } from 'firebase/app'; | |
| import { getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword } from "firebase/auth"; | |
| import { getStorage, ref as storageRef, uploadBytesResumable, getDownloadURL } from "firebase/storage"; | |
| import { getDatabase, ref as databaseRef, set as databaseSet, onValue as databaseOnValue, get as databaseGet, child as databaseChild, off as databaseOff, query as databaseQuery, orderByChild, equalTo } from "firebase/database"; | |
| // TODO: Replace the following with your app's Firebase project configuration | |
| const firebaseConfig = { | |
| apiKey: `${fbConfig.apiKey}`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const handleLogout = (navigation) => { | |
| cometChat.logout().then( | |
| () => { | |
| AsyncStorage.removeItem('auth'); | |
| setUser(null); | |
| navigation.reset({ | |
| index: 0, | |
| routes: [{ name: 'Login' }] | |
| }); | |
| }, error => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useContext } from 'react'; | |
| import { createNativeStackNavigator } from '@react-navigation/native-stack'; | |
| import { CometChatUserListWithMessages, CometChatMessages } from '../cometchat-pro-react-native-ui-kit'; | |
| import Context from '../context'; | |
| const Conversations = () => { | |
| const Stack = createNativeStackNavigator(); | |
| const { cometChat } = useContext(Context); |