Introducing Native Gallery Assist - (iOS/Android/Editor Emulator)

Hi There

We’re happy to introduce the Native Gallery Assist - It’s a plugin for iOS/Android which makes it possible to open the Photo Album/Gallery/Photos inside your game, select a photo and import to the Game as a texture.

We tried to make it as easy to integrate the plugin as possible. The Plugin features a prefab to drag into an existing project as well as some Editor-Only UI for simulating a Gallery in the Unity Editor. Also the integration is a one-liner piece of code which is demonstrated int the demo scene.

Assetstore Link:

We haven’t gotten much response about this plugin for the people who has bought Native Gallery Assist. If you happen to stumble into some issue, please don’t hesitate to write us and we will help you out.

Also we take feature requests kindly so if you want anything to be done, just ask us.

Someone asked if they could use it to take a photo with the Camera using UImagePicker, the short answer is, yes you can do that though it’s not straight forward - There is a ImagePicker (iOS) class which can also open up the Native Camera app to take a snapshot. However this is not wrapped as a common interface since it’s only implemented for iOS and not for android. Also, we advise people to check out our other plugin “Camera Capture Kit” if you want a complete solution for taking a photo with the Camera in Unity.

Cheers

Hi,
Please explain how to change the script NativeGalleryDemo to accept Image/sprite and not RawImage?

Thanks

Hi Orenfridman

Thank you for writing - It’s a good question.

When a texture is returned from the Gallery what you can do is to convert it to a sprite.

var pivot = new Vector2(0.5f, 0.5f);
var rect = Rect(0, 0, textureFromGallery.width, textureFromGallery.height);
var spriteGrappedFromGallery = Sprite.Create(textureFromGallery, rect, pivot);

We have been getting questions if you can use the Native Gallery Assist SDK to open up the camera and take a photo. The short answer is yes, you can do that on iOS however the functionality is not yet available for Android - We did however make a more overall and Unity friendly solution for taking photos called Camera Capture Kit which is available on the assetstore : https://www.assetstore.unity3d.com/en/#!/content/56673

Hi, Thank you, I got the demo working nice and built it on both Android and iOS devices. the issue that I am having is that when I try to pick an image that is 360 (flattened) from a Ricoh Theta camera I am getting just blue background. The file is really large. 5376 x 2688 any suggestions?

1 Like

Could you please try and inspect the image format the image is saved in on the disk of the device ?

.JPEG

The plugin uses Unity’s code for opening up a texture and it sounds like it’s that bit failing , maybe since the texture is more than what is supported by the GPU as a texture. If you’d like I can maybe make a test for you where I try and resize the image with some native code to something more appropriate for the device ? For instance 2048 in width andt then a respective height. Would you be interested in that ?

1 Like

Hi, I’ve sent you this by email but I didn’t get a reply. I really need to make this work today.
I’m testing the demo scene on a Galaxy S6 and when I press Open Gallery the screen turns to dark grey and nothing happens. Is there anything else I need to do?
Also, I need to make the gallery show in a Gear VR app.
Do you think your plug-in can help me with that?
Thanks

Hi Tackyonix

Sorry I’ve missed your mail, good that you wrote here as well. I take it that you already bought the plugin and is experiencing a problem ? Did you try on other devices ? Which version of the Android OS is it running ? and lastly can you please see if you can send me some adb logcat info ?

Cheers

I have the same problem of tachyonix on my phone (Android 5.1) and with my tablet (Android 4.1.2). It doesn’t work. I had send two mail but I didn’t get a reply.

Hi Requim99 - I’ve send you a private message.

1 Like

Thanks for the support! Now everything works well. If can help other users, the problem was my custom Android Manifest. Great asset and great support.

1 Like

Hi. Dear support.
Does your plugin support multiple photo picker? For example if i want to choose multiple photo from photo gallery on iOS devices
Thanks a lot.

Hi Vanava, The plugin currently supports picking one image, however we might be able to add and implement what you’re after. Ive sent you a PM so we can have a discussion about it.

Thanks a lot for your reply

Thanks this helped me…
I moved the Assets\Tastybits\NativeGallery\Manifest\AndroidManifest.xml to Plugins->Android folder for it to work

Hi,
While the gallery is open. How can i know if the user pressed cancel or back?

@gianmonje Hi there! The SDK returns with a null texture in the callback when back/cancel is invoked.