ComScore Module for AMP iOS

Document created by Herberth Alvarado Champion on May 15, 2017Last modified by Herberth Alvarado Champion on May 15, 2017
Version 2Show Document
  • View in full screen mode

Maintainers: David Cortes Saenz & Miguel Lopez Valenciano

 

 

This module’s goal is to ease the integration of ComScore and the Akamai AMP Player for iOS. With just some simple steps a few steps we can achieve this integration, let’s see how.

 

Installation

Just import the AmpComScore.framework in your project. For more information check out the AmpCore’s documentation.

*Note: Make sure to add the frameworks as Embedded Binaries or you’ll get an error about a missing image. *

 

How to Use

Let’s first import the required frameworks:

import AmpCore

import AmpComScore

 

Then, let’s add the related variables in our UIViewController:

var ampPlayer: AmpPlayer!

var ampComScore: AmpComScore!


And it’s time to instantiate them now, in your viewDidLoad function:

// Instantiate player

self.ampPlayer = AmpPlayer(parentView: self.view)

 

// Register yourself as an observer if required
self.ampPlayer.registerObserver(self)

self.ampPlayer.setLicense(license)

self.ampComScore = AmpComScore(publisherId: publisherId, publisherSecret: publisherSecret, ampPlayer: self.ampPlayer!, labels: labels)

self.ampPlayer.handleUrl(url)

 

And that’s basically it, with just those few steps, you have a working integration between AMP and ComScore.

Attachments

    Outcomes