Avatar Creator for Android & iOS
Let users create avatars on their Android and iOS devices.
Users can create Ready Player Me avatars seamlessly in a WebView displayed within a Unity application.
Prerequisites
Ready Player Me SDK. You need the Ready Player Me SDK for Unity installed in your project to retrieve avatars. See the Quickstart guide for instructions.
Ready Player Me SDK Webview. See the Webview installation for instructions.
Deploying the app. In order to test your WebView app, you have to deploy it to a physical or virtual device. See the Unity documentation on how to do that.
Our WebView package includes a custom BuildPostProcessor that automatically adds the following permissions during the build process.
To disable this just add the following define to your project via the player settings for Android and iOS build targets:
RPM_DISABLE_WEBVIEW_PERMISSIONS
Project setup (Android and iOS)
Creating a Scene with a WebView in your Unity project is the same for Android and iOS.
Create or open your Unity project.
Import the Ready Player Me SDK into your project, if you haven't done so already.
Import the Webview sample from Package Manager under Ready Player Me WebView package.
Open the Unity Package manager by going to Window/Package Manager
Find and select the Ready Player Me WebView package
On the right side of the window select or example the Samples section
Find the WebView Sample and the click Import button
Navigate to Assets > Samples > Ready Player Me WebView > VERSION_NUMBER > Webview
Open the Webview Scene.
In the Hierarchy, notice the WebView Canvas game object. It has a child object named WebView Panel with a WebViewPanel script component.
If you select the WebViewPanel in the hierarchy you will see it is already preconfigured with a number of UnityEvents such as:
OnAvatarCreated(string)
This is the event you would use to retrieve the avatar URL after completing the avatar creation process inside the webview.
This is the avatar URL you will use to load an Avatar with the AvatarLoader API's our SDK's provide
OnUserSet(string)
this event can be used to retrieve the userID which can be useful if you need to make authorized requests to our API's
the userID can be stored and used to enable automatic re-login
OnUserAuthorized(string)
OnAssetUnlock(AssetRecord)
this is an event that is fired when the user clicks on a paid asset in the avatar creator
the main purpose of this is for developers to be able to implement their own payment system when it comes to purchasing Ready Player Me paid assets
Open the Build Settings to set up deployment for your chosen platform.
Deploy on Android
In Build Settings, set the Platform to Android.
Check Development Build.
Click Player Settings....
Find Player > Other Settings > Identification. (Optional)
Check Override Default Package Name.
Set a unique Package Name in the format com.YourCompanyName.YourProductName.
Close the Project Settings.
On your device, turn on USB debugging in your Developer Options settings.
Connect your device to your computer.
Click Build and Run.
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
Deploy on iOS
In Build Settings, set the Platform to iOS.
Select Debug and check Development build.
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.
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.
Find Player > Other Settings > Under Configuration > Camera Usage Description and put some descriptive text in this mandatory field.
Find Player > Other Settings > Under Configuration > Microphone Usage Description and put some descriptive text in this mandatory field.
Close Project Settings.
Click Build.
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.
See these resources:
In this tutorial, you will learn to publish applications to iOS. https://learn.unity.com/tutorial/how-to-publish-to-ios-2019-3#5e340ca6edbc2a05676e5676
Last updated