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

Unity

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

Requires Unity 2017.2+

Unity 5.6 and earlier are not supported. The plugin uses UnityWebRequest features introduced in 2017.1, and Screen.safeArea for mobile notch handling introduced in 2017.2.

Step 1. Installation

Find the plugin on Github.

Monetizr is implemented as a singleton prefab. You can find this prefab at Monetizr/Prefabs/Monetizr Prefab. You should place this in the first scene of your game, our code makes sure that there is only 1 prefab instantiated. Out-of-the-box it comes preconfigured with our test access token which can be used to retrieve the "Sample shirt" product.

Note about provided code examples

All Monetizr code is contained within the Monetizr namespace. If given code examples are not working, make sure you have using Monetizr; at the top of your C# script.

Showing the product

The plugin is written using the singleton pattern in order to simplify the workflow. At any time, you can access the current MonetizrMonoBehaviour with MonetizrClient.Instance. Functions are made to be as simple as possible.

You can show a product with a single line of code:

MonetizrClient.Instance.ShowProductForTag("Sample shirt");
Product page using default dark color scheme

Product page using default dark color scheme

Step 2. Retrieve access token

At Monetizr we are working on new reward management platform for your apps. There you will be able to manage your access tokens and related rewards. Until then please contact us at support@themonetizr.com to get in touch and retrieve an access token.

Test access token: 4D2E54389EB489966658DDD83E2D1
Test callback rewards: "Sample shirt", "Sample pin", "Sample gift card".

Step 3. Configuration

Base prefab configuration:

  • Access Token - this is your oAuth Access token, provided by Monetizr;
  • UI Prefab and Web View Prefab - should be left as is although users are free to customize reward UIs to fit their needs.

Additional settings:

  • Color Scheme - customize the product page to fit within the theme of your game with a custom color scheme. Provided are dark and light themes, accessible via the inspector component dropdown.
  • Show Fullscreen Alerts - if something goes wrong this will show an in-game error message. Disable to only output errors to the console;
  • Never Use Web View - on Android and iOS devices the plugin provides an in-game web browser for checkout. If enabled then all platforms will use Unity's Application.OpenURL(string url) instead (except for WebGL which uses a native plugin for opening a new tab);
  • Show Loading Screen - by default Monetizr shows a loading screen while a product page is being initialized. Disable this if you want products to load silently.

Unity


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

Suggested Edits are limited on API Reference Pages

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