The IMVU API for Unity is a library that allows you to

  • Load IMVU's assets, avatars, outfits & friends, from within the Unity game engine
  • Publish images and send invitations from the logged in user
  • Accept IMVU credits for in app purchases

There are two main parts to this library: The REST APIs and the Asset Loaders

Setup

Head over to our Quick Start Guide for instructions on how to install the API and configure your app. That will get you up and running in the editor. Once you're ready to make a build, a few more steps are necessary.

Setup Shaders

In order for IMVU avatars to render properly you need to add the IMVU shaders to your Always Loaded Shaders. To do this, open Edit->Project Settings->Graphics, and add the shaders in the IMVUnity/Shaders folder that you intend to use to the Always Included Shaders list. If you're going to use Unlit materials, include the Unlit shaders. If you're going to use Lit materials, include the Lit shaders. See the Unity documentation on Graphics Settings for more info on how to use these settings.

iOS / Android

For an iOS or Android build, you need to provide a custom protocol for the redirect URL. The protocol is the part of the URL that comes before the ://, so in a typical web URL like http://imvu.com, the protocol is http. You need to come up with a protocol which will be completely unique to your app. If there is another app on the device which uses the same protocol, the user will be prompted which app should handle the login redirect. This prompt will be confusing to the user, and if they choose wrong the login flow will fail. So make sure it's unique. It's recommended that it include both your company name and app name. If you're company is "Great Games" and you're making "Super Awesome Ball", then a good protocol might be great-games-super-awesome-ball.

The domain on the redirect URL, which is what comes directly after the ://, doesn't actually matter in this case, but there needs to be something there for it to be a valid URL. The URL must have a trailing slash after the domain. So if you're using the protocol above, your redirect URL would be something like great-games-super-awesome-ball://whatever/.

This redirect URL needs to be specified for your platform (iOS or Android, or both), both on the developer page on the website, and in the IMVU settings in Unity.

Android

In order to authenticate on Android, the AndroidManifest.xml must contain the proper protocol. The package installs an AndroidManifest.xml file in the /Assets/Plugins/Android/ directory, though if you have an existing Android build you may need to merge it with your existing AndroidManifest.xml. To do that, you'll need to copy the Activity with android:name="com.imvu.oauth.MainActivity" from our manifest to yours. If you do not have an existing Android build with it's own AndroidManifest.xml, you can just use the one we provide as a starting point.

The one change you need to make is to set the protocol you setup for the Android platform. Look for these lines in the manifest file:

<!-- Set your app's custom protocol on the next line -->
<data android:scheme="put-protocol-here" />

And change the put-protocol-here string to your custom protocol. So if your redirect URL is great-games-super-awesome-ball://whatever/, as in the example above, the protocol is great-games-super-awesome-ball, and you'll want to edit it to:

<!-- Set your app's custom protocol on the next line -->
<data android:scheme="great-games-super-awesome-ball" />