Monetizr Developer Hub

Welcome to the Monetizr developer hub. Here you will find user documentation and our API reference guide to get you started.

Get Started    API Reference

Android Plugin Setup

Follow steps in this section to set up and start using Monetizr plugin for Android.

Requires Android SDK version 21+

Lollipop 5.0 and above

Installation

You can install Monetizr plugin via Gradle or Maven. Here's the link to Github.

Gradle install
Add build.gradle file inside your application root folder to install and Monetizr plugin to dependencies list. MavenCentral and Google are added to repositories by default but it's still suggested to check if they are present.

repositories {
  mavenCentral()
  google()
}

dependencies {
  ...
  implementation 'io.monetizr.monetizrsdk:MonetizrSDK:1.0.0'
  ...
}

Maven install

<dependency>
	<groupId>io.monetizr.monetizrsdk</groupId>
	<artifactId>MonetizrSDK</artifactId>
	<version>1.0.0</version>
	<type>pom</type>
</dependency>

Using the plugin

Use the public test token "4D2E54389EB489966658DDD83E2D1". This has to be done once before invoking Monetizr reward view. Note that you are using test token to check connection and installation. In next steps you will start using your actual token. Using apikey needs to be repeated once after every token change. More on that in this section.

MonetizrSdk.apikey = "4D2E54389EB489966658DDD83E2D1"

Now you can test connection with showProductForTag and test value "Sample shirt". Show default reward view:

MonetizrSdk.showProductForTag("Sample shirt")

If everything works you can login to Monetizr Console and retrieve access token for your specific app. That will allow to work with your custom products and applets.

Enable debugging

You can opt-in and enable debugging mode by specifying debuggable property to true. This property will print out messages to Logcat window in Android Studio. With property set to false (default setting) it will ignore error messages and will not interact with host application.

MonetizrSdk.debuggable = true

Required permissions:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Android Plugin Setup


Follow steps in this section to set up and start using Monetizr plugin for Android.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.