Wannads Unity plugin

Current version: 1.0.0 (updated on: 2020-04-01)

Prerequisites

  1. Copy and save your API KEY and API SECRET
  2. Download the Wannads Unity Plugin from here.

Wannads SDK configuration from Android project

  1. Open file with unity; it will be added to the proyect.

    In the "build.gradle" file add the following lines of code:

    repositories {
        ...
        maven { url 'https://maven.google.com' }
        jcenter()
        mavenLocal()
        ...
    }
    dependencies {
        ...
        implementation "com.wannads:android-sdk:2.3.0"
        ...
    }

Wannads SDK configuration from Unity project

  1. Open file with unity; it will be added to the proyect.
  2. Go into the **Player Settings**
  3. Under **Publishing Settings** tick the box for **Custom Gradle Template** (Unity then creates a build.gradle template for you)
  4. The template is in Assets > Plugins > Android > mainTemplate.gradle
  5. Open that file in something like Notepad
  6. Change _ONLY THIS_:
    repositories {
        ...
        maven { url 'https://maven.google.com' }
        jcenter()
        mavenLocal()
    }
    dependencies {
        ...
        implementation "com.wannads:android-sdk:2.3.0"
    }
  7. Save the file then try the build again.

iOS

Not available

Android

public void OnWannadsSurveysClick()
    {
        Wannads.Instance().Init(YOUR_API_KEY, YOUR_API_SECRET, YOUR_SUB_ID);
        Wannads.Instance().ShowSurveysOfferWall();
    }
public void OnWannadsOffersClick()
    {
        Wannads.Instance().Init(YOUR_API_KEY, YOUR_API_SECRET, YOUR_USER_ID);
        Wannads.Instance().SetSubId2("123");
        Wannads.Instance().SetPrimaryColor("#194294");
        Wannads.Instance().SetConfirmButtonColor("#194294");
        Wannads.Instance().SetAge("18");
        Wannads.Instance().SetGender(Wannads.WANNADS_SDK_GENDER_MALE); // 'm' from male and 'f' for female
        Wannads.Instance().ShowOfferWall();
    }

Review SDK documentation here.