Add the SDK to your Unity project

  1. Verify Unity Player Settings

    1. In Unity Editor, open Player Settings pane (Edit  Project Settings  Player)

    2. Switch to Android tab Unity Editor Player Settings for Android Icon

      1. Under Other Settings  Identification

        1. Fill in your app Bundle Identifier

          The value must follow the convention 'com.YourCompanyName.YourProductName' and can contain only alphanumeric characters and underscore.

        2. Set Minimum API Level to Android …​ (API Level 19)

          Unity Editor Player Settings for Android / Other Settings / Identification
      2. Under Publishing Settings  Build

        1. Enable Custom Gradle Template

          Unity Editor Player Settings for Android / Publishing Settings / Build
    3. Switch to iOS tab Unity Editor Player Settings for iOS Icon

      1. Fill in your app Bundle Identifier

      2. Fill in your Automatic Signing Team ID

      3. Under Other Settings  Configuration

        1. Set Target minimum iOS Version to 12

  2. Integrate Facebook SDK for Unity into your project.

    1. Download Facebook Unity SDK v18.0.0 and follow Facebook Unity SDK integration instructions.

    2. Set the following Facebook login permissions:

      email, public_profile

  3. Integrate Smarty SDK for Unity into your project.

    1. Download Smarty Unity SDK v1.13.1.

    2. In the Unity Editor menu, select Assets  Import Package  Custom Package…​. Navigate to the directory where you downloaded Smarty SDK for Unity and select smarty-unity-sdk-x.y.z.unitypackage.

      Unity Assets/Import package menu
    3. Import all of the assets in the package.

      Import package dialog
    4. Save your project.

      A post-build script will add a new menu item "Smarty" to the Unity Editor. If you don’t see this, check your build for compilation errors and try building again.
  4. Verify External Dependency Manager for Unity configuration

    1. Open External Dependency Manager Android Settings dialog (Assets  External Dependency Manager for Unity  Android Resolver  Settings)

    2. Make sure that the following settings are enabled:

      • Use Gradle Daemon

      • Patch mainTemplate.gradle

      • Use Jetifier

    3. Open External Dependency Manager iOS Settings dialog (Assets  External Dependency Manager for Unity  iOS Resolver  Settings)

      1. Make sure that Link frameworks statically option is unchecked.

  5. Configure Smarty SDK

    1. In Unity Editor menu, select Smarty  Edit Settings

    2. Enter Smarty server data that you received from us:

      • server address

      • server port

      • zone name

        Smarty server settings
  6. Initialize Smarty SDK

    1. Open main scene of your project.

    2. Add SmartyInit object.

      1. Create empty object by selecting menu GameObject  Create Empty.

      2. Rename it to SmartyInit.

        Create SmartyInit object
    3. Add SmartyInit script to SmartyInit object

      Add SmartyInit script
    4. Open SmartyInit script and paste the following code:

      using UnityEngine;
      using SmartySDK;
      
      public class SmartyInit : MonoBehaviour
      {
        void Awake ()
        {
          SmartyProvider.Initialize ();
        }
      }
    5. Save scene.

    6. Make sure that SmartyInit object will stay alive through the whole lifetime of your app.

  7. Should you encounter any problems, don’t forget to take a look at Troubleshooting page.