Closed psbdgr8 closed 1 year ago
same issue
@Sun-Woo-Kim if you find any workaround or another Module, please share Thanks.
I think this is may relate to permission https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions
This library rely on Manifest.permission.READ_EXTERNAL_STORAGE
which is not relevant anymore on Android 13
I already solve the problem.
Make sure to ask permissions with react-native-permissions
and for Android 13 or later, check permission for READ_MEDIA_IMAGES
, other than that you can use READ_EXTERNAL_STORAGE
.
You can test screenshot with emulator by using this command
adb shell /system/bin/screencap -p /sdcard/screenshot.png
I made some adjustment too on native module, you can check the PR here https://github.com/AzizAK/react-native-detector/pull/67
For quick fix you can do patch-package
@elmotan95 Thank you so much it resolved my issue. To resolve the problem of the screenshot detection occurring twice and encountering the "lateinit contentObserver has not been initialized" error, I had to perform slight adjustments to the code. You can refer to the changes made in fork #68 for further details.
Thanks! Yeah I got that error too randomly (don't know how to reproduce) after checking your comment.
Thanks! Yeah I got that error too randomly (don't know how to reproduce) after checking your comment.
you can reproduce it by updating React Native script
@psbdgr8 is the fork version work on Android 14?
@NoahSimajji yes it is working with Android 14 as well.
It is working with android 12 and below and iOS 16.5 as well. but not able to detect on Android 13+, any help will be appreciated