Skip to main content

Setup for iOS

Introduction#

The iOS version of the Antidote SDK is compatible with various Unity versions:

  • Unity 6: fully supported
  • LTS 2023: fully supported
  • LTS 2022: fully supported
  • LTS 2021: fully supported
  • LTS 2020: fully supported
  • LTS 2019 and older versions might be supported, but these haven't been officially tested

Setup#

Unity#

Here's how to integrate the Antidote SDK with your Unity game on iOS:

  1. Download the latest version of the Antidote SDK.
  2. Make sure you have TextMesh Pro (TMPro) installed.
    note

    You can check this in Unity's Package Manager by searching for TextMeshPro. See the "Tips & Troubleshooting" section below for detailed instructions.

  3. When the TMP Importer window appears, import TMP Essentials.
  4. Go to Assets/Import Package/Custom Package....
  5. Select the Antidote SDK file you downloaded: unity/antidote-sdk.unitypackage).
  6. Click Import.
  7. Go to Assets/AntidoteSDK/Scenes in the Project Explorer.
  8. Open the AntidoteSetup scene.
    Project Explorer
  9. Go to File/Build Settings....
  10. Click Add Open Scenes.
    Build Settings
  11. Ensure the AntidoteSDK scene is at the top of the list. If not, drag it to the top.
    Setup Object
  12. Close the window.
  13. Configure the features you want to use from Antidote SDK.
  14. Go to the AntidoteSetup/Setup object.
  15. On the Setup object, mark the features you want to enable/disable.
    Configure features
  16. (Optional) On the Watermark Prefab, edit the features to your preference.
    Configure watermark features
  17. Go to File/Build Settings.../Player Settings
  18. Click on Player in the left pane
  19. Click on iOS in the right pane
  20. Scroll down to Supported URL schemes
  21. Click on Size
  22. Change the value to 1
  23. Click on Element 0
  24. Change the value to the URL scheme of your choice
    Xcode
  25. Go to File/Build and Run

XCode#

If you're using Swift you'll need to configure the following in Xcode:

  1. Drag AntidoteSDK-Bridging-Header.h from the SDK zip to your project
  2. Click on your project in the left pane
  3. Click on Build Settings
  4. scroll down to Swift Compiler - General
  5. Double click on Objective-C Bridging Header
  6. Enter the relative path to AntidoteSDK-Bridging-Header.h

Watermark settings#

When you select the Watermark Prefab:

Configure watermark features

You'll have access to the following settings:
FeatureDescription
SpeedThe speed at which the ticker(s) move across the display.
Change Position TimerThe number of seconds before the watermark behaviour updates - this is relevant for the Ticker, DVD and Random behaviours.
BehaviourThe watermark behaviour you want to display.

Game Events#

Events can be emitted during gameplay to track once-off events, and the duration of long-running events. These can be viewed on the session recording.

  1. open the assembly definition in the folder where it needs to be called
    Open assembly definition
  2. scroll down to Assembly Definition References
  3. click on +
    Add assembly reference
  4. click on the dot icon where it says (Missing Reference)
    Select AntidoteSDK
  5. double click on AntidoteSDK

Then, to emit an event add the following to your code:

using AntidoteSDK;
...
AntidoteSDK.Antidote.SendEvent("action", "eventName");

Game Events Data structure#

All game events consist of an action and an event name, where action can be one of the following:

ActionDescription
startmark the start of a long-running event (e.g. boss_battle)
endmark the end of a long-running event (e.g. boss_battle)
onceemit a once-off event (e.g. collected_powerup)

Apple Reviewers#

The Antidote SDK secures your game unauthorised access when players start it directly. When you submit your app to TestFlight, an Apple reviewer will need to be able to access your game without using the Antidote app. To do this, you will need to add login credentials to your TestFlight submission.

You can generate these login credentials by logging into your account at app.antidote.gg:

  1. Click on Games.
  2. Click on your iOS game.
Game view
  1. Click on Security.
  2. If this is the first time you're configuring credentials on your game you will see the following:
Game security view
  1. Click on Renew Credentials and follow the prompts.
Game security credentials view
caution

Save the password somewhere secure as it will not be shown again once the modal is closed. If you do forget the password, you can generate new credentials on this view.

Tips & Troubleshooting#

How to Install TMPro on Unity 2023 and older#

TextMeshPro is required for the Watermark text elements to function. It is part of Unity's default registry, so every project will have access to it without additional downloads. For step by step instructions for installation see below:

  1. Go to Package Manager and ensure you are on Packages: Unity Registry.
  2. Use the search bar to search TextMeshPro or scroll to the correct location
  3. Click Install in the bottom right of the window. If it says Remove or Update, it is already installed.
  4. If the TMP importer appears, click Import TMP Essentials. The Import TMP Examples & Extras is not necessary.
    Setup Object
note

If the Watermark has broken references due to TMPro missing, reimporting the AntidoteSDK Package will fix it after following the above steps.

How to Install TMPro on Unity 6#

TextMeshPro is essential for the Watermark text elements to work. Here's how to install it:

  1. Open the Package Manager and ensure you're on the Unity Registry.
  2. Search for Unity UI or locate it manually.
  3. Click Install. If it's already installed, you'll see Remove or Update.
  4. If the TMP Importer appears, click Import TMP Essentials. You don't need to import TMP Examples & Extras.
note

If the Watermark has broken references due to TMPro missing, reimporting the AntidoteSDK Package will fix it after following the above steps.

My game does not update when I change watermark settings in Unity#

Whenever you change the watermark settings in Unity you will need to do the following before you test the game on an iOS device:

  1. Save your project in Unity.
  2. Click on File/Build and Run.