ReactVision / viro

ViroReact: The AR and VR library for React Native šŸ“³šŸ’™šŸ’›šŸ¤šŸ’š
MIT License
1.36k stars 157 forks source link

Android 13 not able to take screenshot #254

Closed andre-sonect closed 7 months ago

andre-sonect commented 8 months ago

Requirements:

Please go through this checklist before opening a new issue

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: Android OS version (13) or iOS version (17)
  3. Version: ViroReact 2.3.0 and React Native 0.67.5
  4. Device(s): OnePlus 8

Description

When using _takeScreenshot on Android it will always fail while working fine on iOS. I suspect it has something to do with the storage permissions but can't really pinpoint to that since I get as a response not success and errorCode 1.

Reproducible Demo

if (arNavigator.current) {
        var timestamp = Date.now();
        arNavigator.current
          ._takeScreenshot('ar_photo_' + timestamp, true)
          .then(retDict => {
            if (!retDict.success) {
              if (retDict.errorCode === 1) {
                if (Platform.OS === 'ios') {
                  setPhotoLibraryPermissionError(true);
                }
                return;
              }
            }
            navigation.push('PhotoProcess', {
              uri: 'file://' + retDict.url,
              videoObj,
            });
          })
          .catch(error => {
            console.log(error);
          });
      }
linear[bot] commented 8 months ago

XR-161 Android 13 not able to take screenshot

robertjcolley commented 8 months ago

Reproduced on iOS as well See here!