Skip to main content

Requirements

  • Unity 6000 or later
  • Xcode (for iOS builds)
  • Cocoapods (for iOS builds)
  • Android SDK (for Android builds)
2

Importing to Unity

Drag and drop the downloaded .unitypackage file into your Unity editor. Make sure all folders are selected when Unity asks you to choose the folders to be imported into your project.
Make sure you import all folders including Plugins, Scripts, and Prefabs. Missing any folder may cause compilation errors or missing functionality.
3

Creating a Playtolia Game Object

Add the PlaytoliaGameObject to your initial scene to initialize Playtolia components.

Quick setup

Simply drag and drop the PlaytoliaGameObject prefab (located at Assets/PlaytoliaSDK/Prefabs/PlaytoliaGameObject.prefab) to your main scene.

Manual setup

You can create your own PlaytoliaGameObject for customization. Make sure that GameObject name matches “PlaytoliaGameObject” exactly.
1

Create a new game object

Go to your scene and create an empty game object at the root by right clicking in your scene hierarchy and selecting GameObject > Create Empty.
The GameObject must be named “PlaytoliaGameObject” exactly (case-sensitive) to ensure Playtolia Core can send messages to the correct GameObject.
2

Add PlaytoliaGameObject script

Click on your new game object, and use the inspector to add PlaytoliaGameObject script as a new component.The PlaytoliaGameObject script handles:
  • SDK initialization on scene start
  • Message routing between native code and Unity
  • State management for all Playtolia components
4

Configure Playtolia

Navigate to Edit > Project Settings > Playtolia Settings to access the configuration panel.

Essential Configuration

Game ID: Your unique game identifier from the Playtolia dashboard. This is required for all API calls.Logging Level: Control SDK logging verbosity:
  • None: No logging (recommended for production)
  • Error: Only error messages
  • Warning: Errors and warnings
  • Info: General information (recommended for development)
  • Debug: Detailed debugging information

Component Configuration

Authentication: Enable to use login/logout features
  • Authentication Required: If enabled, login dialog appears automatically
  • Providers: Enable Google, Facebook, Apple, Discord, and Guest authentication
Billing: Enable for in-app purchases and store functionality
  • Requires Authentication to be enabled
  • Includes Wallet, Store, and Entitlements APIs
Ticketing: Enable for in-game customer support system
Always test your configuration in Development environment before switching to Production.
5

Platform-specific setup

iOS Setup

  1. Cocoapods Installation: Ensure Cocoapods is installed on your Mac
sudo gem install cocoapods
  1. iOS Deployment Target: Set minimum iOS version to 12.0 or higher in Unity Player Settings
  2. Add iOS Entitlements: Enable this option in Playtolia Settings if using Sign in with Apple

Android Setup

  1. Minimum API Level: Set to API level 21 (Android 5.0) or higher
  2. Target API Level: Use the latest available API level
  3. Internet Permission: Automatically added to AndroidManifest.xml

Verifying Your Setup

Create a simple test scene with the PlaytoliaGameObject and build to your target platform.
TestPlaytolia.cs
using PlaytoliaSDK.Runtime;
using UnityEngine;

public class TestPlaytolia : MonoBehaviour
{
    void Start()
    {
        // Check authentication state
        var authState = PlaytoliaAuth.GetState();
        Debug.Log($"Auth state: {(authState != null ? "Authenticated" : "Not authenticated")}");

        // Note: Store items, wallets, and entitlements will be empty until after authentication
        if (authState != null)
        {
            var storeItems = PlaytoliaStore.GetItems();
            Debug.Log($"Store items available: {storeItems.Count}");
        }
    }
}

Common Issues

Build Errors:
  • “PlaytoliaGameObject script not found” → Ensure you imported all folders from the Unity package
  • iOS build fails with Cocoapods errors → Update Cocoapods and ensure Xcode command line tools are installed
  • Android build fails with permission errors → Check that Unity Android settings allow internet access
Runtime Issues:
  • “Game ID not configured” error → Set your Game ID in Project Settings > Playtolia Settings
  • Authentication always returns null → Ensure Authentication is enabled and you’re connected to the internet
  • Store/Wallet/Entitlements return empty → These APIs only return data after successful authentication

Next Steps