Comments (6)
Hey azzi907,
Looks like your app does not have camera permission, can you check whether you have given camera permission?
from cometchat-sample-app-react-native.
@TirathBhuva camera permission are given already i checked already
from cometchat-sample-app-react-native.
from cometchat-sample-app-react-native.
@TirathBhuva any update on this?
from cometchat-sample-app-react-native.
Hey @azzi907 ,
We were able to reproduce this issue on our end we will fix this in the next release.
For now, you can use this patch.
In the ComposerActions.js replace the takePhoto function with the below function. This should solve the issue.
takePhoto = async () => {
try {
let granted = null;
if (Platform.OS === 'android') {
granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.CAMERA,
{
title: 'CometChat Camera Permission',
message: 'CometChat needs access to your camera ',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
},
);
}
if (
Platform.OS === 'ios' ||
granted === PermissionsAndroid.RESULTS.GRANTED
) {
launchCamera(
{
includeBase64: false,
},
(response) => {
this.sheetRef.current.snapTo(1);
this.props.close();
if (response.didCancel) {
return null;
}
let type = null;
let name = null;
if (Platform.OS === 'ios' && response.fileName !== undefined) {
name = response.fileName;
} else {
type = response.type;
name = 'Camera_001.jpeg';
}
const file = {
name: Platform.OS === 'android' ? response.fileName : name,
type: response.type,
uri:
Platform.OS === 'android'
? response.uri
: response.uri.replace('file://', ''),
};
this.props.sendMediaMessage(file, CometChat.MESSAGE_TYPE.IMAGE);
},
);
}
} catch (err) {
this.sheetRef.current.snapTo(1);
this.props.close();
}
};
from cometchat-sample-app-react-native.
@TirathBhuva thanks
from cometchat-sample-app-react-native.
Related Issues (20)
- There is no way to add a group picture and edit group name HOT 3
- There is a user that is always online HOT 3
- Camera feature should not be required by pro-android-calls-sdk-2.0.0 dependency HOT 3
- React native ios project don't work with the new version of React Native Call HOT 7
- Camera feature should not be required by pro-android-calls-sdk-2.0.1 dependency
- Integrating CometChat library in React native iOS application issues HOT 3
- CometChatCalls HOT 2
- pod install fails HOT 1
- License HOT 2
- Notification not receiving for a group call HOT 4
- [Q] Can this works with OneSignal notification? HOT 1
- Cannot build Android App - No version of NDK matched HOT 2
- How to add specific user to chat list? HOT 3
- False API_KEY_NOT_SET HOT 3
- Testing 2 HOT 2
- npm install failure HOT 6
- Can't run locally on iOS HOT 8
- Cannot read property shouldAutoEstablishSocketConnection HOT 2
- Messages sent when app if offline are lost HOT 2
- Expo: Cannot read property 'BaseInputElement' of undefined HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cometchat-sample-app-react-native.