IOS - Monetize App SDK Documentation

⌘K
  1. IOS - Monetize App SDK Do...
  2. User Manual
  3. Creando un envoltorio
  4. Tagged Wrapper Guidelines

Tagged Wrapper Guidelines

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.

Where To Add The Wrappers?

While it is true that filling your app with ads to the brim is not the best user experience, we recommend you add the wrappers everywhere where there is a blank space on the screen. Aunque you do not want to fill them in, it is okay. We can manage which ones are filled and which are not from the web.

Best Practices When Adding a Wrapper

Creating views, you need to make sure the wrapper view:

  • Do not overlap other wrappers or the app content.

  • Cualquier espacio en blanco es un buen lugar para colocar un contenedor (aunque no tengas pensado utilizarlo).

  • 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.

Limitaciones

  • We can fill either only one wrapper with a tag or all of them: if you want to exclude some wrappers you need to put a different tag to those views, that is grouping. Por ejemplo: si desea que llenemos un envoltorio en la parte inferior de la pantalla que tenga el ads_wrapper Podemos rellenarlo. Sin embargo, si tienes varios envoltorios con la misma etiqueta y quieres rellenarlos todos, pero excluir algunos que tengan la misma etiqueta, eso no es posible. Te recomendamos que pidas consejo a nuestro servicio de asistencia técnica sobre cómo agrupar los envoltorios.

  • To enable tag lookup in the uiViewController’s view hierarchy you will need to call R89SDK.shared.registerLifecycle(uiViewController: self) to register viewController in the SDK. Keep in mind to call it AFTER tag configurations.

    import UIKit
    import R89SDK

    class MyViewController: UIViewController {

        @IBOutlet var topWrapperUIView:UIView!
        @IBOutlet var bottomWrapperUIView:UIView!

        override func viewDidLoad() {
            super.viewDidLoad()
            //Tag configurations
            topWrapperUIView.accessibilityLabel = “top_wrapper_tag”
            bottomWrapperUIView.accessibilityLabel = “bottom_wrapper_tag”
            //Registration of UIViewController
            R89SDK.shared.registerLifecycle(uiViewController: self)
        }
    }

Note that, even though the R89SDK.shared.registerLifecycle(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.


Ejemplo

As mentioned tags can be specified by using the accessibilityLabel to set the tag value, and that can be specified either from the XCodes UI Builder or programmatically, 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

    
    class MyViewController: UIViewController {
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do not forget to register.
            R89SDK.shared.registerLifecycle(uiViewController: self)
        }
    }

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

    
    class MyViewController: UIViewController {

        @IBOutlet var topWrapperUIView:UIView!
        @IBOutlet var bottomWrapperUIView:UIView!
        
        override func viewDidLoad() {
            super.viewDidLoad()
            //Tag configurations
            topWrapperUIView.accessibilityLabel = “top_wrapper_tag”
            bottomWrapperUIView.accessibilityLabel = “bottom_wrapper_tag”
            //Registration of UIViewController
            R89SDK.shared.registerLifecycle(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.

¿Cómo podemos ayudarte?