Closed surajQuitsure closed 1 year ago
Can you give me more info on which react native version you are using and version dependency of react-native-screenguard
?
If you have the frequency of the crash, please provide it for me for better understanding, thanks in advance!
Yes, here is more information:
"react-native": "0.70.6"
"react-native-screenguard": "^0.2.4"
Frequency of crash: 6-7 crashes / day Also I noticed in crashlytics, for all crashes application was in background, let's say user received notification and he pulled down the notification drawer and dismissed the notification, the reopened the application from background then application crashed
Hmm, I understand now. Will have a fix later on.
Can you give me the quick fix so that I can apply that code in node modules, because the application I'm working on has large userbase, if the crashes persists then this application will have major hit on the ranking in playstore
ok, here's work around on the native Android side:
Check ScreenGuardModule.java
and fix the method deactivateShield
like this:
@ReactMethod
public void deactivateShield() {
try {
if (mHandlerBlockScreenShot != null) {
mHandlerBlockScreenShot.post(() -> Objects.requireNonNull(
getReactApplicationContext().getCurrentActivity()
).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE));
mHandlerBlockScreenShot = null;
}
} catch (Exception e) {
e.printStackTrace();
}
}
Remember to double check both background and foreground as well before resubmitting.
Thanks in advance!
I'll add this solution and watch the crashlytics for a while and then will let you know
Mark as done, closing. Feel free to reopen if issue occurred again.
a fix for this will be on next release soon for both stable
and beta
release channels.
This issue has been resolved at ver 0.3.2
, please install and rebuild, thanks!
Thanks!
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: