Welcome to Monetizr Documentation!

Here you will find a comprehensive technical guide
to help you get started with Monetizr SDKs, Plugins,
API reference guide and Console.

Get Started    API Reference

iOS native plugin setup

Native plugin setup replaces the standard Monetizr Unity plugin library with its iOS library. It allows using Apple Pay within mobile Unity games.

📘

Requires Cocoapods. Tested with Unity 2017.2.5f1 and Unity 2019.4.0f1.

The setup process is largely automated, however Cocoapods is needed to install the Monetizr iOS SDK and its dependencies into the exported Unity project. If you do not have Cocoapods installed, here's how you can do it.

Enable the native plugin

In the Monetizr settings window (Window > Monetizr Settings) enable iOS native plugin. When enabled, depending on your Unity version, additional options may appear.

Typically it should be OK to enable both iOS build settings. These options will preconfigure some required settings for the exported project, and are provided as toggles in case of conflict with other plugins.

  • Set bridging header - will force the Swift-ObjC bridging header to the Monetizr bridging header. If other plugins also make use of bridging header, you will need to create a combined bridging header manually and #include "MonetizrUnityBridge.h".
  • Set Swift version - will set a required setting for the iOS build to work. You can also do this manually by setting Swift version for Unity-iPhone project and target to at least 4.0.

Apple Pay support

Enable the Apple Pay toggle, additional settings required for Apple Pay support will show up. See the Monetizr iOS SDK documentation for help!

Installing Monetizr iOS SDK and its dependencies

First, export your project as normal. In the root of your build folder (where the Unity-iPhone.xcodeproj file resides), create a new file called Podfile.

Contents of Podfile for Unity 2019.2 or earlier

target 'Unity-iPhone' do
    use_frameworks!
    pod 'Monetizr', '~> 3.5'
end

Contents of Podfile for Unity 2019.3 or later

use_frameworks!
target 'UnityFramework' do
    pod 'Monetizr', '~> 3.5'
end
target 'Unity-iPhone' do
    pod 'Monetizr', '~> 3.5'
end

With the Podfile in place, open a Terminal at the project location and run pod install. This will install the Monetizr iOS SDK and its dependencies into the project. Additionally, an xcworkspace file will be created.

Building and testing

By this point, the project should be good to go! Open the newly created xcworkspace and build the project as normal!

Updated about a month ago


iOS native plugin setup


Suggested Edits are limited on API Reference Pages

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