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 GUID = selectedConversation.guid; | |
const membersList = [ | |
new cometChat.GroupMember(selectedUser.uid, cometChat.GROUP_MEMBER_SCOPE.PARTICIPANT), | |
]; | |
cometChat.addMembersToGroup(GUID, membersList, []).then( | |
response => { | |
setIsLoading(false); | |
showMessage('Info', `${selectedUser.name} was added to the group successfully`); | |
searchUsers(); |
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 GUID = selectedUser.guid; | |
const UID = selectedUser.uid; | |
cometChat.kickGroupMember(GUID, UID).then( | |
response => { | |
setIsLoading(false); | |
showMessage('Info', `${selectedUser.name} was removed from the group successfully`); | |
searchGroupMembers(); | |
}, |
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( | |
() => { | |
console.log("Logout completed successfully"); | |
AsyncStorage.removeItem('auth'); | |
setUser(null); | |
navigation.reset({ | |
index: 0, | |
routes: [{ name: 'Login' }] |
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 from 'react'; | |
export default React.createContext(null); |
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
<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
... | |
const Chat = (props) => { | |
... | |
const userOnlineListenerId = useRef(uuidv4()); | |
... | |
useEffect(() => { | |
if (selectedConversation) { | |
... | |
// listen for online users. | |
listenForOnlineUsers(); |
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(() => { | |
initCometChat(); | |
... | |
}, []); | |
... | |
const initCometChat = async () => { | |
const { CometChat } = await import('@cometchat-pro/cordova-ionic-chat'); | |
const appID = `${process.env.REACT_APP_COMETCHAT_APP_ID}`; | |
const region = `${process.env.REACT_APP_COMETCHAT_REGION}`; |
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 = () => { | |
AndroidPermissions.requestPermissions([AndroidPermissions.PERMISSION.CAMERA, AndroidPermissions.PERMISSION.RECORD_AUDIO, AndroidPermissions.PERMISSION.READ_EXTERNAL_STORAGE, AndroidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE]); | |
}; |
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 firebase from "firebase"; | |
import "firebase/storage"; | |
const firebaseConfig = { | |
apiKey: `${process.env.REACT_APP_FIREBASE_API_KEY}`, | |
authDomain: `${process.env.REACT_APP_FIREBASE_AUTH_DOMAIN}`, | |
storageBucket: `${process.env.REACT_APP_FIREBASE_STORAGE_BUCKET}` | |
}; | |
const app = !firebase.apps.length |