iOS Native
How to integrate Ready Player Me into iOS native applications.
You can use the Ready Player Me web platform to add avatars to your native iOS application. This general integration guide gives an overview of the main methods of adding avatars to your app.
For integrating the Ready Player Me web platform directly into your native application and retrieving the avatar models URL the general process is as follows:
    Spawn a web browser or switch to a view with an embedded web browser (for example, using WKWebView as in the Swift Example Project)
    Navigate to the desired Ready Player Me URL, e.g
    Inject Javascript code with an eventListener linking a callback to a native function (see Swift Example Project to see an example of this)
    Retrieve the event data (a URL as a string)
On the Ready Player Me web platform the avatar creation process is complete once you hit the "Next" button on the avatar customization screen. You can find the URL with the GLB file in the next step. It is at this time that an event with the id "message" is triggered. This is the event we will be listening for with the eventListener.
Once you have retrieved the generated avatars URL, you can make a web request to download the avatar .glb file. To load this into a 3D scene, you will need to use a third-party framework to supports the loading of .gltf or .glb files as Xcode does not natively support .glb as a 3D file format.
Last modified 4mo ago
Copy link