Skip to main content

iOS

Introduction#

If you are using a non-supported or a custom engine, we also provide the Antidote SDK library so you can directly access its validation and watermark methods.

Configuration#

To integrate the SDK for Custom Engines in your project:

  1. Download the latest version of Antidote SDK for Custom iOS Engines.
  2. Unzip the downloaded file and go to "custom engine" folder.
  3. You will find the antidote_sdk.framework library and headers. Include them to your project.

Initialisation#

- (UIViewController*)setViewController:(UIViewController *)viewController

Example:

myMainCode.m
#import "AntidoteSDK.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// ... your existing code
[[AntidoteSDK sharedInstance] setViewController:nil];
}

Validation#

- (void)validate:(void (^)(BOOL))callback

Example:

myCustomCode.m
#import "AntidoteSDK.h"
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
[[AntidoteSDK sharedInstance] processUrlRequest:url];
[[AntidoteSDK sharedInstance] validate:nil];
return [super application:app openURL:url options:options];
}

Touches#

- (void)showTouches

Example:

myMainCode.m
#import "AntidoteSDK.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// ... your existing code
[[AntidoteSDK sharedInstance] showTouches];
}

Watermarks#

note

Only ticker mode is currently supported. More modes will be added shortly!

- (void)showWatermark

Example:

myMainCode.m
#import "AntidoteSDK.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// ... your existing code
[[AntidoteSDK sharedInstance] showWatermark];
}

Events#

- (void)emitGameEvent:(NSString *)action withName:(NSString *)event

Example:

myMainCode.m
#import "AntidoteSDK.h"
-(void)killEnemy:(NSObject *)enemy {
// ... your existing code
[[AntidoteSDK sharedInstance] emitGameEvent:@"once" withName:@"killed_enemy"];
}

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)

User Information#

To access the Antidote User ID of the user opening the game, you can use the following function:

[[AntidoteSDK sharedInstance] getUserId]

The returned string is the user ID.

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 are 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.