Install the Teak SDK in Unity
It’s time to open your game in the Unity Editor and install the Teak SDK.
-
Teak supports
Unity 2020
or newer. -
On Android, Teak requires the External Dependency Manager for Unity, which is installed with the Firebase Unity SDK.
Add the Teak SDK in the Unity Editor
The easiest way to install Teak is using the Unity Package Manager and installing via git URL.
Installing via Git URL
-
In the Unity Editor select,
. In the Package Manager panel, find the small dropdown menu in the top left corner. Select + -
Enter this git URL for the latest Teak SDK:
https://github.com/GoCarrot/upm-package-teak.git
-
Click the Add button.
-
When the progress bars finish, the Teak for Unity SDK is installed. You should now see Teak in the Edit menu of your Unity project.
If you are using Assembly Definitions in Unity you will also need to reference Teak’s .asmdef
file from your Assembly Definition Asset. See Unity’s doc on Referencing another assembly.
Installing via Asset Menu
Alternatively, you can download the lastest SDK here, and import it using in the Unity Editor.
Configure Teak in the Unity Editor
Next, we need to copy our settings from your Teak Dashboard and enter them in our Unity project. If you don’t have an app in Teak, you need to create a new game.
-
On your Teak Dashboard, navigate to
. -
In the Unity Editor select
to open the Teak Settings in the Inspector. (Note: Make sure the Inspector Tab is visible.)We’ll be copying the Teak App ID, Teak API Key, and ShortLink Domain into Unity.
-
Copy your Teak App ID and Teak API Key from your Teak Settings and paste them into the same field in the Teak Settings in Unity.
These store the Teak App Id and API Key for use by Teak’s runtime and helpers.
-
If the ShortLink Domain is setup, copy the full URL and paste it into Unity. The blue copy button will copy the correct format.
Short Links are required for rewarding and email. The URL will be customer facing, so get it approved by marketing. You can add this later if you need to. -
The checkbox for "Build Post-Processing" should be checked.
This automates the native iOS and Android integration. If you need to disable this, you will need to manually manage and configure the iOS dependencies and the Android dependencies.
-
The checkbox for "Trace Logging" should be checked during integration and testing.
This enables additional logging from the Teak SDK to the Unity Debug Log allowing you to quickly verify that Teak SDK calls are being made as expected.
Initialize Teak on Android
There’s an extra step to intialize Teak on Android.
-
Add this to the main activity in your
AndroidManifest.xml
file. Firebase should have created an AndroidManifest.xml file, or you can create one manually.<meta-data android:name="io.teak.sdk.initialize" android:value="true"/>
This uses Firebase’s initialization of ContentProviders to auto-initialize Teak. If this step does not work for your game, please see the additional methods for initialization.
Code Signing on iOS
-
The
TeakNotificationService
andTeakNotificationContent
targets will need to be signed on iOS. Xcode should take care of this when you sign the iOS-Unity target, but if you are getting provisionsing profile errors, check to make sure these targets are signed as well.Setting up your Signing Team ID in Unity ( ) will sign everything automatically when you build for iOS.
The Teak SDK is now installed, we’re ready to add Teak code to your game logic.