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.
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
MonetizrClient.Instance. Functions are made to be as simple as possible.
You can show a product with a single line of code:
Product page using default dark color scheme
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 email@example.com to get in touch and retrieve an access token.
Test access token: 4D2E54389EB489966658DDD83E2D1
Test callback rewards: "Sample shirt", "Sample pin", "Sample gift card".
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.
- 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.