Requires iOS version 10.0+
Installation
You can install Monetizr plugin via CocoaPods or manually from Github.
CocoaPods install
Add Monetizr to your Podfile
in Xcode project.
pod 'Monetizr', '~> 3.5'
Run the install command.
pod install
This will download and install the plugin with dependencies.
To make sure you have the latest version you can use the update command.
pod update 'Monetizr'
Manual install
Find the plugin on Github. Copy "Monetizr-SDK" folder to your project and resolve dependencies.
Dependencies
https://github.com/Alamofire/Alamofire
https://github.com/Alamofire/AlamofireImage
https://github.com/zvonicek/ImageSlideshow
Using the plugin
Import "Monetizr" to your project:
import Monetizr
Use the public test token 4D2E54389EB489966658DDD83E2D1
and in applicationDidFinishLaunching(_:) do the initialization:
Monetizr.shared.token = "4D2E54389EB489966658DDD83E2D1"
Now you can test a connection with showProduct
and test value T-shirt
. Show default Offer View:
Monetizr.shared.showProduct(tag: T-shirt, presenter: UIViewController?, presentationStyle: UIModalPresentationStyle?) { success, error, product in ()}
You can customize Offer View settings. If you choose to show a product in a view provided in the plugin you should provide a presenter view and presentation style. Without presentation style it will default to UIModalPresentationStyle.overCurrentContext
.
If everything works you can login to Monetizr Console to create Monetizr account and retrieve an access token for your specific app. That will allow working with your custom products.
Updated 8 months ago
What's Next
Creating account |