Swift Module: TagManagement

Swift Module: TagManagement

by on ‎04-28-2017 10:18 AM - edited 3 weeks ago by Community Manager (89 Views)
This guide shows how to install and use the TagManagement module from the Tealium Swift library. This module works in conjunction with your iQ Tag Management account to run compatible tags in your Swift app.
In this article:
Table of Contents Placeholder

Features

Requirements

  • Mobile Profile in iQ (see Creating a Mobile Profile)
  • Swift 3.0+
  • Access to Apple's UIKit framework on the target platform (iOS, watchOS)

Installation & Configuration

The TagManagement module can be found in the main repo's tealium/tagmanagement folder.  Add the entire folder to the target project.  The Tealium-Swift core library will auto instantiate the module.

To disable the module, do one of the following:

  • delete or dereference the module folder files from the target project
  • set the module's configuration 'enabled' property to 'false'

Methods

tealiumWebViewDidFinishLoad

tealiumWebViewDidFinishLoading(webView:UIWebView)
Parameters Description
webView Module instance of an unrendered UIWebView object.
// SAMPLE
func tealiumWebViewDidFinishLoading(webView:UIWebView) {

let urlString = webView.request.url.absoluteString
print("Tealium Tag Management configuration endpoint URL is: \(urlString)")

}

tealiumWebViewDidFailToLoad

tealiumWebViewDidFailToLoad(webView:UIWebView, error:Error)
Parameters Description
webView Module instance of an unrendered UIWebView object.
error The Error returned
// SAMPLE
func tealiumWebViewDidFailToLoad(webView:UIWebView, error:Error) {

print("Tealium Tag Management failed to load UTAG with error: \(error)")

}

Change Log

Build 1 - Initial