ReactVision / viro

ViroReact: The AR and VR library for React Native πŸ“³πŸ’™πŸ’›πŸ€πŸ’š

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android 13 not able to take screenshot

andre-sonect opened this issue Β· comments

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);
          });
      }

Reproduced on iOS as well See here!