Home > Blockchain >  Screenshot fail to store in ios devices
Screenshot fail to store in ios devices

Time:07-28

I use Screenshot code that works perfectly on pc, but not on ios devices.

typically ios devices wii ask for permission to assess the photos library.

but it didn't?

public IEnumerator CaptureScreen()
    {
        yield return null;

        yield return new WaitForEndOfFrame();

        ScreenCapture.CaptureScreenshot(Application.persistentDataPath   $"/Screenshot.png");
    }

I also use fellow code,it;s no work

byte[] pngShot = ImageConversion.EncodeToPNG(tex_transparent);
System.IO.File.WriteAllBytes(Application.persistentDataPath   $"/Screenshot{index}.png", pngShot);

CodePudding user response:

Application.persitentDataPath is not the path for the library of the gallery app. You need to create a custom native solution or maybe get an asset from the asset store to save images to the gallery.

  • Related