Avatar Creator for Android & iOS
Users can create Ready Player Me avatars seamlessly in a WebView displayed within a Unity application.

Prerequisites

  • Ready Player Me SDK. You need the Unity SDK installed with your project to retrieve avatars. See the links below for download and setup instructions.
In order to test your WebView app, you have to deploy it to a physical or virtual device. Check out the Unity documentation on how to do that.

Project setup (Android and iOS)

Creating a Scene is the same for either platform.
  1. 1.
    Create or open your project in Unity. You must have the Ready Player Me SDK imported.
  2. 2.
    Navigate to the folder Assets > Plugins > Ready Player Me > Examples > Webview Examples.
  3. 3.
    Open the WebviewExample Scene.
  4. 4.
    In the Hierarchy, notice the WebviewTest game object. It has a WebViewTest script component, as well as a Canvas with some buttons.
  5. 5.
    In the Webview folder, open the WebviewTest script and familiarize yourself with the content.
    • Variables for a GameObject avatar, as well as fields for the UI elements.
    • Start() adds Listeners to the buttons.
    • DisplayWebView() creates a Webview for the Avatar Creator if there isn't one.
    • OnAvatarCreated(). Once the avatar has been created by the user, it destroys any existing avatar, instantiates an AvatarLoader and loads the current avatar.
    • HideWebView() hides the WebView.
    • OnAvatarImported() sets the avatar to the imported avatar.
    • Destroy() cleans up the listeners.
  6. 6.
    Open Build Settings to set up deployment for your chosen platform.

Deploy on Android

  1. 1.
    In Build Settings, set the Platform to Android.
  2. 2.
    Check Development Build.
  3. 3.
    Click Player Settings....
  4. 4.
    Find Player > Other Settings > Identification.
    • Check Override Default Package Name.
    • Set a Package Name in the format com.YourCompanyName.YourProductName.
  5. 5.
    Find Player > Other Settings > Under Configuration > Camera Usage Description and put some descriptive text in this mandatory field.
  6. 6.
    Find Player > Other Settings > Under Configuration > Microphone Usage Description and put some descriptive text in this mandatory field.
  7. 7.
    Close the Project Settings.
  8. 8.
    On your device, turn on USB debugging in your Developer Options settings.
  9. 9.
    Connect your device to your computer.
  10. 10.
    Click Build and Run.
  11. 11.
    Once the app opens on your device, click the button. Give permissions and off you go.
Alternatively, you can build the APK and deploy it on your own.
For release builds, see the Unity and Android documentation.

Troubleshooting

  1. 1.
    If you don't have a subdomain, this warning will pop up, and you can click Continue with 'demo' subdomain.
    ​
  2. 2.
    If your package name does not comply with the required format, you will get this warning and can't continue until you fix it.
    ​

Deploy on iOS

  1. 1.
    In Build Settings, set the Platform to iOS.
  2. 2.
    Select Debug and check Development build.
  3. 3.
    Find Player > Other Settings > Identification.
    • Check Override Default Package Name.
    • Before you build your Project for iOS, make sure that you set the Bundle Identifier (reverse DNS - same as Android package name).
    • Set a Package Name in the format com.YourCompanyName.YourProductName.
    • Fill in the Signing Team ID (not required for Debug builds to complete).
    • You can also choose whether your app targets the simulator or an actual device. To do this, change the SDK version** >> Target SDK to Simulate SDK or Device SDK.
  4. 4.
    Find Player > Other Settings > Under Configuration > Camera Usage Description and put some descriptive text in this mandatory field.
  5. 5.
    Find Player > Other Settings > Under Configuration > Microphone Usage Description and put some descriptive text in this mandatory field.
  6. 6.
    Close Project Settings.
  7. 7.
    Click Build.
  8. 8.
    In the file explorer, find your Builds folder and in it the Unity-iPhone.xcodeproj.
Publication follows the the standard procedure for publishing Unity projects to iOS.
Publishing for iOS is different from publishing for platforms such as Windows or macOS. Due to restrictions in access to development tools, Unity can only create an Xcode project for an iOS game or app and not build the binary directly.
In this tutorial, you will learn to publish applications to iOS. https://learn.unity.com/tutorial/how-to-publish-to-ios-2019-3#5e340ca6edbc2a05676e5676
Copy link
On this page
Prerequisites
Project setup (Android and iOS)
Deploy on Android
Deploy on iOS