Setup for iOS
Introduction
The iOS version of the Antidote SDK is compatible with various Unreal Engine versions:
| Engine Version | Support |
|---|---|
| 5.0 – 5.7 | ✅ Supported |
| 4.26 – 4.27 | ✅ Supported |
| 4.25 and older | ⚠️ Not officially tested |
Only C++ projects are currently supported. Blueprint projects are not yet supported.
Setup
Unreal
Here's how to integrate the Antidote SDK with your Unreal Engine game on iOS:
- Download the latest version of Antidote SDK for Unreal.
- If you don't have a
Pluginsfolder yet, create it. - Unzip the downloaded file
- Copy the folder
AntidoteSDKinto your project'sPluginsfolder. The result will be:/YourProject/Plugins/AntidoteSDK/. - Generate the project Files.
- Close the editor.
- Recompile the project in Visual Studio.
- Add AntidoteSDK as a dependency in your project's build file. Example:
using UnrealBuildTool;
public class YourProject : ModuleRules
{
public YourProject(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] {
"Core",
"CoreUObject",
"Engine",
"InputCore",
"HeadMountedDisplay",
// this line adds AntidoteSDK as a dependency
"AntidoteSDK",
// this is required for the watermark
"UMG"
});
}
}
- In your GameMode's
BeginPlay, initialize the SDK with the desired options. Example:Example: YourProjectGameMode.cpp// (...) <-- Other Includes#include "Antidote.h"#include "AntidoteWatermark.h"void YourProjectGameMode::BeginPlay(){Super::BeginPlay();// (...) <-- Some Awesome Configuration// Antidote InitializationTMap<FString, bool> Options;Options.Add(TEXT("validate"), true);Options.Add(TEXT("showTouches"), true);Options.Add(TEXT("showWatermark"), false);UAntidote::Setup(Options);UAntidote::Load();}validate- verify that the player is authorized to launch the game, and terminate if they aren'tshowTouches- display user touches on screenshowWatermark- enable watermarking
- To enable Watermarking, one more step is required.
- Add the following to each of your
GameModeclasses:YourProjectGameMode.hclass AYourProjectGameMode : public AGameModeBase{GENERATED_BODY()public:// (...) <-- Some Awesome Existing CodeTSubclassOf<class UAntidoteWatermark> watermarkClass;virtual void BeginPlay() override; // <---}; - On your
GameModebase class add this code:YourProjectGameMode.cpp// (...) <-- Other Includes#include "Antidote.h"#include "AntidoteWatermark.h"YourProjectGameMode::YourProjectGameMode(): Super(){// (...) <-- Some Awesome Existing Code// Find and set the watermarkClass variablestatic ConstructorHelpers::FClassFinder<UAntidoteWatermark> wmClassFinder(TEXT("/AntidoteSDK/BP_Watermark"));watermarkClass = wmClassFinder.Class;}void YourProjectGameMode::BeginPlay(){Super::BeginPlay();// (...) <-- Some Awesome Existing Code// Antidote InitializationTMap<FString, bool> Options;Options.Add(TEXT("validate"), true);Options.Add(TEXT("showTouches"), true);Options.Add(TEXT("showWatermark"), true);UAntidote::Setup(Options);// Watermark Initializationif (watermarkClass){auto watermark = CreateWidget<UAntidoteWatermark>(GetWorld(), watermarkClass);watermark->AddToPlayerScreen(9999);UAntidote::SetWatermark(watermark);TMap<FString, float> Settings;Settings.Add(TEXT("textSpeed"), 70.f);Settings.Add(TEXT("changePositionSpeed"), 15.f);UAntidote::ConfigureWatermark(Settings);UAntidote::EnableWatermark(FLinearColor(1.0f, 0.0f, 0.0f, 0.8f));UAntidote::ChangeWatermarkBehaviour(UAntidoteWatermark::BehaviourType::TICKER);}UAntidote::Load();}
- Add the following to each of your
If you have multiple GameModes in your project, you have to add the watermark initialization code to each.
XCode
If you're using Swift you'll need to configure the following in Xcode:
- Drag
AntidoteSDK-Bridging-Header.hfrom the SDK zip to your project - Click on your project in the left pane
- Click on
Build Settings - scroll down to
Swift Compiler - General - Double click on
Objective-C Bridging Header - Enter the relative path to
AntidoteSDK-Bridging-Header.h
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:
- Click on
Games. - Click on your iOS game.
- Click on
Security. - If this is the first time you are configuring credentials on your game you will see the following:
- Click on
Renew Credentialsand follow the prompts.
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 create a GameMode Class
- Go to Unreal Editor.
- Click
File/New C++ Class. - Scroll down, select
GameMode(Base class of the heads-up display). - Click
Next. - Set a Name (e.g YourProjectGameMode).
- Click
Create Class. - Go to
ProjectSettings/Maps & Modes. - Set GameMode to your custom GameMode.
I can't see touches in my game
Displaying touches is not currently supported on iOS due to incompatibility with the Metal framework.
Unreal Editor doesn't start or shows an error regarding a plugin is not found
- Close Unreal Editor.
- Open the project in Xcode.
- Clean Build.
- Rebuild.
- Open the project in Unreal Editor again.