Open nextechar-hardik opened 1 year ago
Can I see your code?
Okay let me create demo project and will share that here.
I only need to see your usage of PickFile function. You can copy your C# code here.
Hello.
First of all, thanks for the hard work and the code quality. I have dug a bit to understand what UnityNativeFilePicker was doing exactly and it is very clear.
I am having the same issue so I am updating this post as I assume @nextechar-hardik wont.
I have an abstraction layer on top of UnityNativeFilePicker so I can use different methods to pick files (or pick files on other systems), so I won't give the full code as it is not related, but it ends up calling the following:
string[] extensions = new [] {
NativeFilePicker.ConvertExtensionToFileType("png"),
NativeFilePicker.ConvertExtensionToFileType("jpg"),
NativeFilePicker.ConvertExtensionToFileType("jpeg"),
NativeFilePicker.ConvertExtensionToFileType("gltf"),
NativeFilePicker.ConvertExtensionToFileType("glb")
}
NativeFilePicker.PickFile(path => Debug.Log(path), extensions);
Only png, & jpeg files can be picked. GLTF & GLB are not displayed.
I found the following post that might be useful: https://developer.apple.com/forums/thread/716575
Nevermind, it works with the deprecated method too. My code was just garbage. I'll try to find another answer to why it fails then.
GLB and GLTF don't exist in the filetype lists I've posted: https://github.com/yasirkula/UnityNativeFilePicker?tab=readme-ov-file#a-importing-files. The only possible solution is to allow picking all files and then check the returned files' extensions in the callback function.
Description of the bug
Not able to select .glb file from storage in iOS devices.
Reproduction steps
Use file picker code with following condition if (fileExtension == ".glb" || fileExtension == ".gltf" || fileExtension == ".obj")
its working fine in Editor / Android but not working in iOS , not able to select .glb file.
Platform specs