1. IOS – Monetize App ...
  2. Demo Apps

Demo Apps

Each demo represents the initialization type and how they are configured from the point of view of a Publisher. Please, keep in mind they have been done for the purpose of showcasing the solution and and may not be optimized or with correct design patterns.


Single Tag Demo

Repo Link to check the demos’ fork and clone the repo and test the apps locally.


Purpose

This demo showcases the use of Tagged Wrappers and Triggers. There are wrappers in all Screen UIViewControllers.
The demo app showcases

  • How to initialize the SDK with an enabled single tag.

  • How to show Ads by putting tags on the screens.

  • How to show interstitial by putting a tag on the button.

  • How to show interstitials on screen-to-screen transitions.

  • How to incorporate ads in the infinite scroll.

Description

The initial screen contains only a single button “Initialize“ which will start the initialization of the SDK. Before the initialization, it will do a manual configuration of the single tag for the FirstViewController and the SecondViewController. See the startInitialization method inside the InitializationViewController.

After the initialization app will navigate to the FirstViewController where the main use cases are demonstrated for the single tag.

The FirstViewController e SecondViewController have tag configurations done in the XCode’s UI Builder.

In the FirstViewController the Ad wrapper container is located at the bottom of the screen, and it is tagged with pub_wrapper_tag.

In the FirstViewController the “SHOW INTERSTITIAL THEN PRESENT“ button is tagged as well.

It is configured to display interstitial Ads before running its action. In other words, SDK will intercept the tap event on that button, display an interstitial ad, and last, run the button’s original action after the interstitial gets closed. see the startInitialization method inside the InitializationViewController.

In the SecondViewController there are two Ad wrapper containers, the first on the top of the screen and the second on the bottom.

Note that both have the same tag named pub_wrapper_tag, so SDK will put Ads in both of them, and that is possible because the SecondViewController has been configured with getAllWithTag: true, see the startInitialization method inside the InitializationViewController.


Manual Demo.

Repo Link, if you want to check the demos fork and clone the repo and test the apps locally


Purpose

This demo showcases how to use RefineryAdFactory with each ad format and also illustrates how quickly, in terms of lines of code added, you can add monetization to the app.

The demo app showcases

  • How to initialize the SDK in the manual mode.

  • How to display a banner or out-stream advertisement on the screen.

  • How to display an interstitial advertisement.

  • How to incorporate ads inside the scrollable views such as table view or collection view.

Description

The fake data could come from our Database to test delay times but only if you have an api key, for the api key you need to make an account.

First, the initialization of the SDK takes place inside the AppDelegate’s initializeR89SDK method.

        class AppDelegate: UIResponder, UIApplicationDelegate {

            func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
                initializeR89SDK()
                return true
            }
            
            func initializeR89SDK(){
                // Enable the debug mode
                R89SDK.shared.setLogLevel(level: LogLevels.debug)
                // Set to use local fake data by getLocalFakeData = true
                R89SDK.shared.setDebug(getLocalFakeData: true, forceCMP: true, useProductionAuctionServer: false)
                // Initialize the SDK
                R89SDK.shared.initialize(publisherId: “TestRefinery89ID”, appId: “TestDemoApp”, singleLine: false, publisherInitializationEvents: RSDKInitializationEventsDelegate())
            }
        }
    

In the ViewController the adContainer advertisement wrapper container is placed at the bottom of the screen with a gray background. The SDK will put the advertisement inside the adContainer to display a banner or out-stream ads. See the addBanner e addOutstream methods that demonstrate how to display ads in the wrapper.

Como podemos ajudar?