Closed HanggiAnggono closed 4 months ago
@HanggiAnggono hi, thx for report this. can you share react-native version?
@HanggiAnggono hi, thx for report this. can you share react-native version?
im using version 0.66.5 as of now
@HanggiAnggono thx. i will try iOS 12 for check for it asap
@HanggiAnggono thx. i will try iOS 12 for check for it asap
thank you, really appreciate it
@HanggiAnggono hello I've been testing with iOS 12 and RN 0.66 and it seems to be working fine. Can you tell me how you are using the function? Is it possible that the modal is popping up after the function is called? If use like this case, possibility it's not work, but i will fix this in the future.
@HanggiAnggono hello I've been testing with iOS 12 and RN 0.66 and it seems to be working fine. Can you tell me how you are using the function? Is it possible that the modal is popping up after the function is called? If use like this case, possibility it's not work, but i will fix this in the future.
import { useFocusEffect } from "@react-navigation/native";
import { useCallback, useState } from "react";
import {
CaptureProtection,
CaptureProtectionModuleStatus,
} from "react-native-capture-protection";
export const useScreenRecordDetect = ({ enabled }: { enabled: boolean }) => {
const [isRecording, setIsRecording] = useState(false);
async function protectScreen() {
CaptureProtection.preventScreenshot();
CaptureProtection.preventScreenRecord();
CaptureProtection.addEventListener(({ status }) => {
if (status === CaptureProtectionModuleStatus.RECORD_DETECTED_START) {
setIsRecording(true);
}
});
}
function releaseProtection() {
CaptureProtection.allowScreenshot();
CaptureProtection.allowScreenRecord();
setIsRecording(false);
}
useFocusEffect(
useCallback(() => {
if (enabled) {
protectScreen();
} else {
releaseProtection();
}
return () => {
releaseProtection();
};
}, [enabled]),
);
return { isRecording };
};
useScreenRecordDetect({enabled: true});
That's how I use the library. I don't quite understand what do you mean by modal
@HanggiAnggono hello sir
As you reported, i have confirmed that it does not work on iOS 12 or earlier. i try to fix that quickly In the meantime, we recommend using it on iOS 13 or later.
sorry that this happened to you
@HanggiAnggono hello sir
As you reported, i have confirmed that it does not work on iOS 12 or earlier. i try to fix that quickly In the meantime, we recommend using it on iOS 13 or later.
sorry that this happened to you
thank you for the confirmation sir
@HanggiAnggono Hi. With the new features being added, it looks like support for iOS 12 will not be possible, sorry.
Thanks for the great library. I checked that this lib is set with
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
but when I try using iOS 12, the protection is not working at all. I use these functions