Wannads Unity plugin
Current version: 1.0.0 (updated on: 2020-04-01)
Prerequisites
- Copy and save your API KEY and API SECRET
- Download the Wannads Unity Plugin from here.
Wannads SDK configuration from Android project
-
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
- Open file with unity; it will be added to the proyect.
- Go into the **Player Settings**
- Under **Publishing Settings** tick the box for **Custom Gradle Template** (Unity then creates a build.gradle template for you)
- The template is in Assets > Plugins > Android > mainTemplate.gradle
- Open that file in something like Notepad
-
Change _ONLY THIS_:
repositories { ... maven { url 'https://maven.google.com' } jcenter() mavenLocal() } dependencies { ... implementation "com.wannads:android-sdk:2.3.0" }
- 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.