Triumph Docs
Search…
⌃K

Install Triumph

Get up and running with Triumph. Estimated Time: 15 minutes.

Developer Account

To explore Triumph before signing up for a free developer account, you can use gameId = "" in the steps below to access Triumph's Sandbox mode.
Create a Triumph developer account here. You'll be prompted to create an Organization and your first game.

Install

Triumph currently supports games written in Swift and Unity (targeted for iOS distribution).
Unity
Swift
Download our Unity Package here. Once downloaded, you can import it in one of two ways:
  1. 1.
    Double click on the .unitypackage file.
  2. 2.
    Navigate to Assets > Import Package > Custom Package and select the downloaded .unitypackage file.
Before building your Xcode project, install brew.
Your game must target Swift 5.7 or greater.
​
TriumphSDK is distributed through Cocoapods. If this is your first time using Cocoapods, you can find installation guides here. Install cocopods in your project before proceeding.
  1. 1.
    First, install our Cocoapods plugin by running the following from any directory in terminal.
    sudo gem install cocoapods-triumph-sdk-plugin
  2. 2.
    Next add the TriumphSDK pod to your podfile. Make sure this is embedded under use_frameworks!
    target 'YourGame' do
    ​
    use_frameworks!
    pod 'TriumphSDK'
    end
  3. 3.
    Add the following at the bottom of your podfile. Be sure to do this after the end statement at the bottom of your podfile.
    plugin 'cocoapods-triumph-sdk-plugin'
    post_install do |installer|
    installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
    # Feel free to change it from 14.0 to whatever minimum version do you use for your application
    # This will remove all of the CocoaPods dependencies warnings regarding minimum iOS version
    if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 14.0
    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
    end
    # Unfortunately, when using .xcframeworks like our application, CocoaPods does not set this flag by default
    # Thus, this leads to a linkage error, and this setting is required
    config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
    # We're using some dependencies that contain bundles which by default are set to be resigned
    # This is required to make your build successful
    if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
    config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
    end
    end
    end
    end
  4. 4.
    Run pod install at the root of your project to install Triumph.

Import

Unity
Swift
In your Unity project click on Tools > TriumphSDK > Generate Unity Native Methods
​
​
This will generate file TriumphUnityNativeMethods:
using UnityEngine;
using UnityEngine.SceneManagement;
​
namespace TriumphSDK
{
public class TriumphUnityNativeMethods : MonoBehaviour, ITriumphUnityNativeMethods
{
// place your game ID here
public static readonly string gameId = "";
​
// place your merchant ID here
public static readonly string merchantId = "";
​
public void TriumphStartedGame()
{
/* TODO: implement method */
}
​
public void TriumphDidDismiss()
{
/* TODO: implement method */
}
​
public void TriumphDidPresent()
{
/* TODO: implement method */
}
​
public void TriumphWillDismiss()
{
/* TODO: implement method */
}
​
public void TriumphWillPresent()
{
/* TODO: implement method */
}
}
}
Then, you need to click Tools > TriumphSDK > Generate API Prefab
​
​
Which will generate Prefab file called TriumphAPI. This prefab is an empty GameObject with two important MonoBehaviour components: TriumphAPI and TriumphUnityNativeMethods. Ensure that this prefab is in the first loaded scene of your game (i.e. the main menu).
Navigate to Assets -> Triumph -> Prefabs to find the TriumphAPI Prefab. Add it to the top level of your scene.
​
Now, navigate to the TriumphUnityNativeMethods component of the TriumphAPI prefab. Grab the gameId for your game from the Triumph Dashboard (under your game's go live tab) and set it to the gameId variable in this file.
using UnityEngine;
using TriumphSDK;
​
public class TriumphUnityNativeMethods: MonoBehaviour, ITriumphUnityNativeMethods {
// REQUIRED CONFIG IMPLEMENTATION
/*
* Put your gameId here! Use gameId = "" if you want to test
* out our Sandbox mode before creating a dev account
*/
public static readonly string gameId = "YOUR_GAME_ID"
}
Be sure to import TriumphSDK at the top level of any file that uses Triumph.
To configure Triumph Leaderboards, navigate to the AppDelegate.swift willFinishLaunchingWithOptions method, and add the configuration method Triumph.configure. Grab the gameId for your game from the Triumph Dashboard and pass it in as a parameter.
import TriumphSDK
​
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
/*
* @Params:
* gameId -- Your game ID
*/
TriumphKit.configure(gameId: "YOUR_GAME_ID")
return true
}
You're now ready to integrate Triumph functionality into your game.