Skip to content

SDK integration

  • Unity: 6 (6000.0) or higher
  • Minimum API Level (Android): 24 or higher
  • Target API Level (Android): 36 or higher
  • Target deployment (iOS): 15.0 or higher
  1. First, you need to download the Unity package from the following link:

    Download Wortise Unity Package
  2. Once downloaded, double click on the file to import it into the project.

    The package includes the External Dependency Manager for Unity, which downloads the native Android and iOS SDKs. If your project already contains it, uncheck the ExternalDependencyManager folder in the import window to keep a single copy.

In Project Settings → Player → Publishing Settings, enable the Custom Main Gradle Template, Custom Gradle Properties Template and Custom Gradle Settings Template options. Then, select Assets → External Dependency Manager → Android Resolver → Resolve in the Unity menu bar, so the Wortise SDK and its Maven repositories are added to those templates.

The iOS SDK is installed with CocoaPods when the Xcode project is generated. Open the generated .xcworkspace file instead of the .xcodeproj one.

To setup the SDK, go to the Wortise → Settings option in the Unity menu bar. After selecting the option, the settings window will open where you must specify the Google application IDs for each platform:

Window screenshot

The IDs are saved in Assets/Resources/WortiseSettings.asset and applied when the app is built, so set them before building:

  • Android: the ID is written to the com.google.android.gms.ads.APPLICATION_ID entry of Assets/Wortise/Plugins/Android/WortiseManifest.androidlib/src/main/AndroidManifest.xml.
  • iOS: the ID is written to the GADApplicationIdentifier key of the Info.plist file of the generated Xcode project.

When the app is built for iOS, the SDK automatically raises the target version to 15.0 when it is lower, and adds the SKAdNetworkItems list required by the ad networks to the Info.plist file.

The SDK does not show the App Tracking Transparency prompt. If you want to request this permission to the user, add the NSUserTrackingUsageDescription key to the Info.plist file and request the authorization from your app before loading the first ad (for example, with the iOS 14 Advertising Support package from Unity).

You can consult the following section to implement this request and obtain the user consent: User consent

To initialize the SDK, you need to add the following lines in the Start() method of the first project Scene. Also, we recommend to implement the OnInitialized event to request the consent once the initialization has finished:

void Start() {
...
WortiseSdk.OnInitialized += () => {
WortiseConsentManager.RequestIfRequired();
};
WortiseSdk.Initialize("your app key");
}

To verify the integration, the SDK provides a test mode that allows the app to always receive ads.

In addition to the option that is available in our dashboard, you can programmatically enable this test mode, from the SDK itself, by using the following code:

WortiseAdSettings.IsTestEnabled = true;