# Native iOS implementation

**URL:** <https://forum.babylonjs.com/t/native-ios-implementation/36591>\
**Category:** Questions\
**Created:** [December 15, 2022, 10:17pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591 "2022-12-15T22:17:46Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 15, 2022, 10:17pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/1 "2022-12-15T22:17:46Z")

</div>

Hello  
I am trying to use the Babylon js on a native iOS project  
On the playground there is not an example with a glb file  
Is it possible to give me one  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 15, 2022, 10:20pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/2 "2022-12-15T22:20:59Z")

</div>

cc [@BabylonNative](https://forum.babylonjs.com/groups/babylonnative)

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [December 15, 2022, 11:08pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/3 "2022-12-15T23:08:16Z")

</div>

Check our docs here: [Multiple Platforms | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/BabylonCrossPlat/multiplePlatforms)

If you have specific questions, feel free to ask here. 😉

---

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 16, 2022, 5:25am UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/4 "2022-12-16T05:25:37Z")

</div>

I am sorry but I still not found any specific example  
Can you please help me thx

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [December 16, 2022, 4:32pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/5 "2022-12-16T16:32:30Z")

</div>

If you follow the steps to build BabylonNative on iOS, the playground will display a simple cube that you can rotate around with touch.  
experience.js is the script that is being run. You can change these lines for example to load a .glb instead of creating the cube:

> <https://github.com/BabylonJS/BabylonNative/blob/599008710819cc4ca6b828dc37b81f76485779f6/Apps/Playground/Scripts/experience.js#L46>

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [December 16, 2022, 5:29pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/6 "2022-12-16T17:29:19Z")

</div>

@Cedric gave you an example of BabylonNative running on iOS. I sent you to the docs because it’s not clear what tech you should be using without more information. Using BabylonNative might be right, but it could also be overkill for your scenario.

---

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 18, 2022, 8:33am UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/7 "2022-12-18T08:33:09Z")

</div>

Thank you very much Cedric  
So with my understanding i will not be able to give to the script a dynamic url ?

---

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 19, 2022, 10:51am UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/8 "2022-12-19T10:51:31Z")

</div>

After adding the function ImportMesh, i get this error:  
document.createElement is not a function. (In ‘document.createElement(“a”)’, ‘document.createElement’ is undefined)

---

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 19, 2022, 2:02pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/9 "2022-12-19T14:02:51Z")

</div>

Any update please ?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 19, 2022, 4:00pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/10 "2022-12-19T16:00:50Z")

</div>

As the banner right on top of the forum shows, many of the team members are on vacation so response times will be slower (and they can never be immediate anyways 🙃 )

Just to confirm, have you followed the exact steps at [BabylonNative/BUILDING.md at master · BabylonJS/BabylonNative (github.com)](https://github.com/BabylonJS/BabylonNative/blob/master/BUILDING.md#building-on-macos-targeting-ios), built the Playground demo app without errors, then just changed the experience.js script?

---

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 19, 2022, 5:44pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/11 "2022-12-19T17:44:31Z")

</div>

ohh ok sorry  
Yes of course everything works fine.  
With some glb files i get this error

---

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 19, 2022, 5:45pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/12 "2022-12-19T17:45:20Z")

</div>

It seems like the babylonJs is not easy to use for a native iOS app

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [December 19, 2022, 6:30pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/13 "2022-12-19T18:30:44Z")

</div>

@Yankelm Can you explain in more detail what you are doing? Are you using Babylon Native? Are you running the playground app? What glb files are working and what are not working? It’s hard to help without more information.

---

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 19, 2022, 7:41pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/14 "2022-12-19T19:41:44Z")

</div>

Yes i am using babylon Native.  
Yes i am running the playground app.  
I get this error:  
document.createElement is not a function. (In ‘document.createElement(“a”)’, ‘document.createElement’ is undefined)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 19, 2022, 7:44pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/15 "2022-12-19T19:44:18Z")

</div>

> [@bghgary](#):
>
> What glb files are working and what are not working?

@Yankelm we need all the information we can get, as we can’t know what is going on your machine otherwise

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [December 19, 2022, 9:33pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/16 "2022-12-19T21:33:46Z")

</div>

@Yankelm a repro is most of the time a way to help us help you 🙂

Please not that Draco and KTX are not supported in native so far.

---

<div class="post-metadata">

**Author:** ![Yankelm](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yankelm/32/28808_2.png) [@Yankelm](https://forum.babylonjs.com/u/Yankelm)\
**Post date:** [December 20, 2022, 7:29am UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/17 "2022-12-20T07:29:14Z")

</div>

i get an url that is not working

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [December 20, 2022, 4:39pm UTC](https://forum.babylonjs.com/t/native-ios-implementation/36591/18 "2022-12-20T16:39:40Z")

</div>

This is the reason:

```auto
  "extensionsUsed": [
    "KHR_draco_mesh_compression"
  ],
  "extensionsRequired": [
    "KHR_draco_mesh_compression"
  ],

```

We don’t support Draco in Babylon Native yet.
