Skip to main content

iOS

URL Scheme Configuration

Add your custom URL scheme to Info.plist:
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>mygame</string>
        </array>
    </dict>
</array>
Or configure in Unity:
  1. Go to EditProject SettingsPlayeriOS
  2. Expand Other Settings
  3. Add your URL scheme under Supported URL schemes
The SDK handles deep links automatically. Ensure your redirect URIs match:
// Must match your URL scheme
passport = await Passport.Init(
    clientId: "YOUR_CLIENT_ID",
    environment: Environment.Sandbox,
    redirectUri: "mygame://callback",      // ← mygame matches Info.plist
    logoutRedirectUri: "mygame://logout"
);

Build Settings

  1. Set Target minimum iOS Version to 13.0 or higher
  2. Enable Automatically Sign or configure your provisioning profile

iOS-Specific Notes

  • The login flow uses ASWebAuthenticationSession, which shows a system alert: “[App] Wants to Use ‘immutable.com’ to Sign In”. This cannot be removed or customized.
  • Deep links work via URL schemes (not Universal Links) for PKCE security.

Android

AndroidManifest Configuration

Add the intent filter for deep linking:
<activity android:name="com.immutable.passport.PassportActivity"
          android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="mygame" android:host="callback" />
    </intent-filter>
</activity>

<!-- For logout redirect -->
<activity android:name="com.immutable.passport.PassportLogoutActivity"
          android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="mygame" android:host="logout" />
    </intent-filter>
</activity>

Unity 6 Configuration

If using Unity 6 with the new Android activity system:
  1. Go to Project SettingsPlayerAndroidConfiguration
  2. Set Application Entry Point to Activity (not GameActivity)
  3. Remove UnityPlayerGameActivity from your AndroidManifest if present

Build Settings

  1. Set Minimum API Level to 24 or higher
  2. Set Target API Level to 33 or higher
  3. Enable Custom Main Manifest if you need to modify AndroidManifest.xml

Android-Specific Notes

  • The login flow uses Chrome Custom Tabs
  • Ensure Chrome is installed on test devices
  • The SDK automatically handles the manifest merge for most cases

WebGL

Authentication Flow

WebGL uses a popup-based flow instead of redirects:
#if UNITY_WEBGL
    await passport.LoginWithPopup();
#else
    await passport.Login();
#endif

Build Settings

  1. Go to Project SettingsPlayerWebGLPublishing Settings
  2. Enable Decompression Fallback
  3. Set Compression Format to Gzip or Disabled for development

Hosting Requirements

  • Host on HTTPS (required for secure authentication)
  • Configure CORS headers if calling external APIs
  • Add your hosting domain to redirect URIs in Hub

WebGL Template

For custom templates, ensure the Immutable scripts are included:
<!-- In your index.html template -->
<script src="Build/{{{ LOADER_FILENAME }}}"></script>

WebGL-Specific Notes

  • Popup blockers may interfere with login. Ensure LoginWithPopup() is called from a user gesture (button click)
  • localStorage is used for session persistence
  • Some browser features may be restricted in WebGL context

macOS

URL Scheme Configuration

Add to Info.plist (similar to iOS):
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>mygame</string>
        </array>
    </dict>
</array>

Build Settings

  1. Set Target minimum macOS Version to 10.15 or higher
  2. Sign your application for distribution

Windows

Default WebView

The SDK uses Unity Web Browser (UWB) by default on Windows.

IL2CPP Support

The default WebView doesn’t support IL2CPP. For IL2CPP builds, use a custom WebView like Vuplex. See Advanced Configuration.

Build Settings

  1. Set Scripting Backend to Mono for default WebView compatibility
  2. Or configure a custom WebView for IL2CPP

Platform Detection

Handle platform-specific flows:
async void Login()
{
    #if UNITY_WEBGL && !UNITY_EDITOR
        await passport.LoginWithPopup();
    #else
        await passport.Login();
    #endif
}

Testing

PlatformRecommended Testing Method
iOSPhysical device or Simulator
AndroidPhysical device or Emulator
WebGLLocal HTTPS server or hosted build
WindowsEditor or standalone build
macOSEditor or standalone build
Testing in Unity Editor uses the desktop WebView. Always test on target platforms before release.

Next Steps