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.
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
- 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.
Enable the Apple Pay toggle, additional settings required for Apple Pay support will show up. See the Monetizr iOS SDK documentation for help!
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
target 'Unity-iPhone' do use_frameworks! pod 'Monetizr', '~> 3.5' end
use_frameworks! target 'UnityFramework' do pod 'Monetizr', '~> 3.5' end target 'Unity-iPhone' do pod 'Monetizr', '~> 3.5' end
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.
By this point, the project should be good to go! Open the newly created xcworkspace and build the project as normal!
Updated 9 months ago