I want to call snapShotTaker function from inside of HelloWorldApp function but i get ERROR TypeError: undefined is not a function, js engine: hermes in terminal. How to solve this problem?
notifee.registerForegroundService(notification => {
return new Promise(() => {
// Long running task...
setInterval(() => {
HelloWorldApp.snapShotTaker();
}, 2000);
});
});
const HelloWorldApp = () => {
const isAppForeground = useIsForeground();
console.log('In Foreground?: ', isAppForeground);
const cameraRef = useRef(null);
const [finalPath, setPhotoPath] = useState('');
const devices = useCameraDevices();
const device = devices.front;
if (device == null) {
return <ActivityIndicator style={styles.indicator} size="large" />;
}
const snapShotTaker = async () => {
const snapshot = await cameraRef.current.takeSnapshot({
quality: 20,
skipMetadata: true,
});
setPhotoPath('file://' + snapshot.path);
};
functionkeyword