'How to share .scn file as .usdz file?

I am creating an app where users can scan objects in 3D, I have a scene which I can easily save in documents directory and share it in .scn format, but I want to share this .scn file as .usdz file via UIActivityController.

Basically I am using this library https://github.com/StandardCyborg/StandardCyborgCocoa

In this library, a scene file is saved as .gltf format, but I want to share this .gltf file which is not supported on iOS devices. Apple only support .usdz file format. So, I want to convert this .gltf file into .usdz file before sharing.

I have been searching different solutions over internet for a week, but nothing is working till now.

Can anyone help me to resolve this issue?

Any help is greatly appreciated.



Solution 1:[1]

It's not documented, but SCNScene's write method works with a .usdz URL, at least since iOS 14.7. This is what I'm using in my app.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 HackerFoo