I make short POC using this SDK and sometimes I am getting the error Cannot read property 'localStorage' of undefined.
I suppose localStorage is not part of the React Native environment.
The issue is reproduced from time to time.
Steps to reproduce:
1) create App at CometChap pro dashboard
2) init and log in using superhero1 or superhero2 or superhero3 user ( test users provided by service )
useEffect(() => {
setLoading(true)
const appSetting = new CometChat.AppSettingsBuilder()
.subscribePresenceForAllUsers()
.setRegion(REGION)
.build()
CometChat.init(APP_ID, appSetting).then(
() => {
console.log('Initialization completed successfully')
CometChat.login('superhero2', AUTH_KEY).then(
User => {
console.log('Login Successful:', { User })
// User loged in successfully.
},
error => {
console.log('Login failed with exception:', { error })
// User login failed, check error and take appropriate action.
},
)
},
error => {
console.log('Initialization failed with error:', error)
// Check the reason for error and take appropriate action.
},
)
return () => CometChat.logout()
}, [])
I make short POC using this SDK and sometimes I am getting the error Cannot read property 'localStorage' of undefined. I suppose localStorage is not part of the React Native environment.
The issue is reproduced from time to time.
Steps to reproduce: 1) create App at CometChap pro dashboard 2) init and log in using superhero1 or superhero2 or superhero3 user ( test users provided by service )
Platform: Android (28 SDK) "@cometchat-pro/react-native-calls": "^1.0.3", "@cometchat-pro/react-native-chat": "2.1.4", "react-native": "0.62.2",