showImagePicker doesn't work on device

Options
SlideUp
SlideUp Posts: 46 🔥

Hey!

The sample code from https://docs.snap.com/api/lens-studio/Classes/Providers/#ImagePickerTextureProvider--faceRect works only on the simulator.

For it to work on device a delay needs to be added.

Example:

// @input Asset.Texture imagePickerTexture
var delayedEvent = script.createEvent("DelayedCallbackEvent");
delayedEvent.bind(function(eventData)
{
script.imagePickerTexture.control.showImagePicker();
});
delayedEvent.reset(1);

@stevenxu

thanks

Answers

  • Bakari Mustafa
    Bakari Mustafa Posts: 178 🔥🔥🔥
    Options

    It's also worth noting that this is a known issue with the ImagePickerTextureProvider class and it's recommended to use this delay to make it work on a device.