1.0.12 • Published 12 months ago
react-native-screenshot-url v1.0.12
react-native-screenshot-url
Install
yarn add react-native-screenshot-url
Usage
import ScreenShotUtil, { CallbackInfo } from 'react-native-screenshot-url';
const [screenShotUri, setScreenShotUri] = useState<string | undefined>(undefined);
useEffect(() => {
ScreenShotUtil.startListener((res: CallbackInfo) => {
console.log('- [Start] screenShot callback res.code=', res.code);
if (res.code === '200') {
setScreenShotUri(res.uri);
//region 5s消失术
if (timeoutIdRef.current) {
clearTimeout(timeoutIdRef.current);
}
console.log('- [Start] screenShot 5s wait start');
timeoutIdRef.current = setTimeout(() => {
console.log('- [Start] screenShot 5s wait end');
setScreenShotUri(undefined);
}, 5000);
//endregion
} else if (res.code === '198') {
console.log('- [Start] screenShot callback 198 show permission description');
showDescription('AAAAA', 'BBBBBO', 'mediaPermission');
} else if (res.code === '199') {
console.log('- [Start] screenShot callback 199 hide permission description');
PermissionUtil.hideDescriptionWithDialogName('mediaPermission');
}
}, '截屏,screen');
return () => {
ScreenShotUtil.stopListener();
};
});
Features
- support 22 - 32 permissions about images READ_EXTERNAL_STORAGE
- support Android API level 33 permissions about images READ_MEDIA_IMAGES
- startListener without permission
- permission request is built-in before callback
Reference
1.0.9
12 months ago
1.0.8
12 months ago
1.0.7
12 months ago
1.0.11
12 months ago
1.0.10
12 months ago
1.0.12
12 months ago
1.0.6
1 year ago
1.0.5
1 year ago
1.0.4
1 year ago
1.0.3
1 year ago
1.0.2
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago
0.0.10
1 year ago
0.0.9
1 year ago
0.0.8
1 year ago
0.0.7
1 year ago
0.0.6
1 year ago
0.0.5
1 year ago
0.0.4
1 year ago
0.0.3
1 year ago
0.0.2
1 year ago
0.0.1
1 year ago