Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

What

...

are they?

The tagged wrapper is an iOS UIView with a requirement to have accessibilityLabel specified, either from the XCode UI builder or programmatically. This is used to find the views in the Single tag where you want us to add the monetization inventory. You need to add as many as you can, remember that placing a tagged wrapper does not mean we need to use it.

Example

As mentioned tags tag values can be specified by using the accessibilityLabel to set the tag value, and that can be specified via UIView’s accessibilityLabel parameter either from the XCodes XCode’s UI Builder or programmatically, here .

Set tag from UI builder (recommended)

Here is what it looks like in the UI Builder. Here we have a blue wrapper on top and a green one on the bottom. Accordingly, the top wrapper has specified to have a tag named top_wrapper_tag and the one in the bottom bottom_wrapper_tag.

...

In this case, the UIViewController looks like this

Code Block
languageswift
import UIKit
import R89SDK
class MyViewControllerMainViewController: UIViewController {
    ...
    override func viewDidLoad() {
        super.viewDidLoad()
        ...
        // DoThis line notis forgetnecessary to register inform R89SDK about app navigation.
        R89SDK.shared.registerLifecycleregisterUIViewController(uiViewController: self)
    }
    ...
}

Set tag programmatically (alternative)

As an alternative approach, we can specify the accessibilityLabel programmatically, without using the UI Builder using code, here is the equivalent setup but from the UIViewController.

Code Block
languageswift
import UIKit
import R89SDK

class MyViewControllerMainViewController: UIViewController {
    
    @IBOutlet var topWrapperUIView:UIView!
    @IBOutlet var bottomWrapperUIView:UIView!
    ...
    override func viewDidLoad() {
        super.viewDidLoad()
        ...
        //Tag configurations Setting tags programmatically 
        topWrapperUIView.accessibilityLabel = "top_wrapper_tag"
        bottomWrapperUIView.accessibilityLabel = "bottom_wrapper_tag"
        //Registration of UIViewController This line is necessary to inform R89SDK about app navigation.
        R89SDK.shared.registerLifecycleregisterUIViewController(uiViewController: self)
    }
    ...
}

Note that the tags are named differently but they can be the same as well, in that case, SDK will put the same advertisement in both wrappers, if that is your intended behavior make sure to set getAllWithTag: true while doing the single tag configuration for the screen.

Where To Add The Wrappers?

...

Where to add the wrappers?

Everywhere you have a white space. Tagged wrappers don’t need to contain ads, it's just for flexibility and future-proofing. Indeed, overloading your app with ads is not the best user experience, but the wrappers don’t need to be filled with ads, that’s why we recommend you add the wrappers everywhere where there is a blank space on the screen. Even if you do not want to fill them in, it is okay.

We can manage which ones are filled and which are not filled from the web interface.

Best

...

practices when adding a wrapper

For Creating the wrappers you need to make sure ensure the wrapper view:

  • Do not overlap other wrappers or on the app content, no matter the size it takes. if it is a space that you have a max Size to it, put it in the tag name.

  • Every blank space is a good space for a wrapper (even if you do not plan to use it).

  • Do not use only one tag for all of your wrappers, it will be hard to configure your monetization and change it according to your needs. So use as many different tags as possible (like id’s but you can have some of them repeated when it makes sense).

  • Use a blank (no subviews) UIView as the wrapper view.

Limitations

  • We can fill either only one wrapper all of the wrappers with a tag or all of themjust the first one we find with that tag: if you want to exclude some differentiate any wrappers you need to put assign a different tag to those views, that is grouping. E.g.: if you want us to fill a wrapper at the bottom of the screen that has the tag ads_wrapper we can fill that. However, if you have multiple wrappers with the same tag, and you want to fill all of them and exclude some others while having the same tag, it’s not possible. We encourage you to ask for advice from to our technical support on how to group wrappers.

  • To enable tag lookup in the uiViewController’s view hierarchy and screen navigation tracking you will need to call R89SDK.shared.registerLifecycle(uiViewController: self) in the UIViewController.viewDidLoad() method to register viewController in the SDKexplicitly notify the R89SDK about screen load event. Keep in mind to call it AFTER tag configurations.

    Code Block
    languageswift
    import UIKit
    import R89SDK
    
    class MyViewControllerMainViewController: UIViewController {
        
        @IBOutlet var topWrapperUIView:UIView!
        @IBOutlet var bottomWrapperUIView:UIView!
        ...
        override func viewDidLoad() {
            super.viewDidLoad()
            ...
            //Tag configurations Setting tags programmatically 
            topWrapperUIView.accessibilityLabel = "top_wrapper_tag"
            bottomWrapperUIView.accessibilityLabel = "bottom_wrapper_tag"
            //Registration of UIViewController This line is necessary to inform R89SDK about app navigation.
            R89SDK.shared.registerLifecycleregisterUIViewController(uiViewController: self)
        }
        ...
    }
    
Info

Note that, even though the This limitation and R89SDK.shared.registerLifecycleregisterUIViewController(uiViewController: self) is consise and straighforward to use we are working on the functionality that will automatically register UIViewControllers without need to call registerLifecycle method externally. At some point it will be removed or become optional to call registerLifecycle as the SDK will handle that internally might be removed in forthcoming versions and replaced with an automatic screen-tracking approach.