As per the google crashlytics, while registering the ScreenGuard module application is crashing in some devices.
Devices: Motorola edge 40 - Android 13, Nothing Phone(1) - Android 13, etc.
My implementation of ScreenGuard in react native:
import { useColorScheme } from 'react-native';
const isDarkMode = useColorScheme();
useEffect(() => {
const screenCaptureColor = isDarkMode === "dark" ? Colors.darker : Colors.lighter
ScreenGuardModule.register(screenCaptureColor, (_) => {
console.log("ScreenGuradModule registered")
});
//handling android backpress
const onbackPress = async () => {
navigation.pop();
};
const backHandler = BackHandler.addEventListener(
'hardwareBackPress',
onbackPress,
);
return async () => {
backHandler.remove();
ScreenGuardModule.unregister()
};
}, []);
As per the crashlytics reports are:
ScreenGuardModule.lambda$deactivateShield$2
java.lang.NullPointerException
java.util.Objects.requireNonNull (Objects.java:220)
com.screenguard.ScreenGuardModule.lambda$deactivateShield$2 (ScreenGuardModule.java:6)
As per the google crashlytics, while registering the ScreenGuard module application is crashing in some devices.
Devices: Motorola edge 40 - Android 13, Nothing Phone(1) - Android 13, etc.
My implementation of ScreenGuard in react native:
As per the crashlytics reports are: