...
After creating the Gift Rain from the RMC panel, as in the in-app message, each time you call a customEvent, it is checked whether there is a Gift Rain and then the Gift Rain is displayed.
...
App Banner
To use the App Banner action, you first need to create and add a UIView in your application where you want it to appear. Then, you can call the getBannerView method to show banners within this UIView. Below, you can find an example of creating a UIView and displaying banners within it.
Code Block |
---|
let bannerView = UIView()
bannerView.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(bannerView)
NSLayoutConstraint.activate([bannerView.topAnchor.constraint(equalTo: self.view.topAnchor,constant: 80),
bannerView.heightAnchor.constraint(equalToConstant: 80),
bannerView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
bannerView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor)])
bannerView.backgroundColor = .black
var props = [String:String]()
props["OM.inapptype"] = "banner_carousel"
RelatedDigital.getBannerView(properties: props) { banner in
if let banner = banner {
banner.delegate = self
banner.translatesAutoresizingMaskIntoConstraints = false
bannerView.addSubview(banner)
NSLayoutConstraint.activate([banner.topAnchor.constraint(equalTo: bannerView.topAnchor),
banner.bottomAnchor.constraint(equalTo: bannerView.bottomAnchor),
banner.leadingAnchor.constraint(equalTo: bannerView.leadingAnchor),
banner.trailingAnchor.constraint(equalTo: bannerView.trailingAnchor)])
}
} |
f you wish, you can send extra query parameters with the properties parameter. If you don't want to use it, you can change the properties parameter to properties: [String:String].
When your users perform a click action on the banner, deeplinks need to be handled and redirected by you. To do this, you can capture the URL using the RDInappButtonDelegate protocol. An example usage is as follows:
First, you must call the delegate method.
Code Block |
---|
RelatedDigital.inappButtonDelegate = self |
Then, you can add the extension block and modify the following code according to your needs.
Code Block |
---|
extension ViewController: RDInappButtonDelegate {
func bannerItemClickListener(url: String) {
print(url)
}
} |
Product Stat Notifier
The Product Stat Notifier action that you define in the RMC Panel works in Product View, Add to Cart and Add/Remove Favorites events. You must make sure that the product id is sent in these events.
...