Skip to main content
Version: 0.5.3

Advertising Module


Version 0.5.3

OpenRPC

This document was generated from an OpenRPC JSON-Schema, and is intended to provide a human readable overview and examples of the methods contained in the module.

For the full schema, see the link below.

Schema
advertising.json

Table of Contents

Usage

To use the Advertising module, you can import it into your project from the Firebolt SDK:

import { Advertising } from '@firebolt-js/sdk'

Overview

A module for platform provided advertising settings and functionality.

Events

Methods

config

Build configuration object for Ad Framework initialization

function config(options: AdConfigurationOptions): Promise<AdConfiguration>

Parameters

ParamTypeRequiredSummary
optionsAdConfigurationOptionstrueConfiguration options

Promise Resolution

TypeDescription
AdConfigurationAn opaque object represneting the AdConfiguration

Examples

Initializing the Ad Framework
JavaScript
import { Advertising } from '@firebolt-js/sdk'

Advertising.config({"environment":"prod","authenticationEntity":"MVPD"})
.then(adFrameworkConfig => {
console.log(adFrameworkConfig)
})

Value of adFrameworkConfig

{
"adServerUrl": "http://demo.v.fwmrm.net/ad/p/1",
"adServerUrlTemplate": "http://demo.v.fwmrm.net/ad/p/1?flag=+sltp+exvt+slcb+emcr+amcb+aeti&prof=12345:caf_allinone_profile &nw=12345&mode=live&vdur=123&caid=a110523018&asnw=372464&csid=gmott_ios_tablet_watch_live_ESPNU&ssnw=372464&vip=198.205.92.1&resp=vmap1&metr=1031&pvrn=12345&vprn=12345&vcid=1X0Ce7L3xRWlTeNhc7br8Q%3D%3D",
"adNetworkId": "519178",
"adProfileId": "12345:caf_allinone_profile",
"adSiteSectionId": "caf_allinone_profile_section",
"adOptOut": true,
"privacyData": "ew0KICAicGR0IjogImdkcDp2MSIsDQogICJ1c19wcml2YWN5IjogIjEtTi0iLA0KICAibG10IjogIjEiIA0KfQ0K",
"ifaValue": "01234567-89AB-CDEF-GH01-23456789ABCD",
"ifa": "ewogICJ2YWx1ZSI6ICIwMTIzNDU2Ny04OUFCLUNERUYtR0gwMS0yMzQ1Njc4OUFCQ0QiLAogICJpZmFfdHlwZSI6ICJzc3BpZCIsCiAgImxtdCI6ICIwIgp9Cg==",
"appName": "FutureToday",
"appBundleId": "FutureToday.comcast",
"distributorAppId": "1001",
"deviceAdAttributes": "ewogICJib0F0dHJpYnV0ZXNGb3JSZXZTaGFyZUlkIjogIjEyMzQiCn0=",
"coppa": 0,
"authenticationEntity": "60f72475281cfba3852413bd53e957f6"
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "advertising.config",
"params": {
"options": {
"environment": "prod",
"authenticationEntity": "MVPD"
}
}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"adServerUrl": "http://demo.v.fwmrm.net/ad/p/1",
"adServerUrlTemplate": "http://demo.v.fwmrm.net/ad/p/1?flag=+sltp+exvt+slcb+emcr+amcb+aeti&prof=12345:caf_allinone_profile &nw=12345&mode=live&vdur=123&caid=a110523018&asnw=372464&csid=gmott_ios_tablet_watch_live_ESPNU&ssnw=372464&vip=198.205.92.1&resp=vmap1&metr=1031&pvrn=12345&vprn=12345&vcid=1X0Ce7L3xRWlTeNhc7br8Q%3D%3D",
"adNetworkId": "519178",
"adProfileId": "12345:caf_allinone_profile",
"adSiteSectionId": "caf_allinone_profile_section",
"adOptOut": true,
"privacyData": "ew0KICAicGR0IjogImdkcDp2MSIsDQogICJ1c19wcml2YWN5IjogIjEtTi0iLA0KICAibG10IjogIjEiIA0KfQ0K",
"ifaValue": "01234567-89AB-CDEF-GH01-23456789ABCD",
"ifa": "ewogICJ2YWx1ZSI6ICIwMTIzNDU2Ny04OUFCLUNERUYtR0gwMS0yMzQ1Njc4OUFCQ0QiLAogICJpZmFfdHlwZSI6ICJzc3BpZCIsCiAgImxtdCI6ICIwIgp9Cg==",
"appName": "FutureToday",
"appBundleId": "FutureToday.comcast",
"distributorAppId": "1001",
"deviceAdAttributes": "ewogICJib0F0dHJpYnV0ZXNGb3JSZXZTaGFyZUlkIjogIjEyMzQiCn0=",
"coppa": 0,
"authenticationEntity": "60f72475281cfba3852413bd53e957f6"
}
}

policy

Get the advertising privacy and playback policy

function policy(): Promise<AdPolicy>

Promise Resolution

TypeDescription
AdPolicyDescribes various ad playback enforcement rules that the app should follow.

Examples

Getting the advertising policy settings
JavaScript
import { Advertising } from '@firebolt-js/sdk'

Advertising.policy()
.then(adPolicy => {
console.log(adPolicy)
})

Value of adPolicy

{
"skipRestriction": "adsUnwatched",
"limitAdTracking": false
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "advertising.policy",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"skipRestriction": "adsUnwatched",
"limitAdTracking": false
}
}

advertisingId

Get the advertising ID

function advertisingId(): Promise<object>

Promise Resolution

the advertising ID

FieldTypeDescription
ifastring
ifa_typestring
lmtstring

Examples

Getting the advertising ID
JavaScript
import { Advertising } from '@firebolt-js/sdk'

Advertising.advertisingId()
.then(advertisingId => {
console.log(advertisingId)
})

Value of advertisingId

{
"ifa": "01234567-89AB-CDEF-GH01-23456789ABCD",
"ifa_type": "idfa",
"lmt": "0"
}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "advertising.advertisingId",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"ifa": "01234567-89AB-CDEF-GH01-23456789ABCD",
"ifa_type": "idfa",
"lmt": "0"
}
}

deviceAttributes

Get the device advertising device attributes

function deviceAttributes(): Promise<object>

Promise Resolution

TypeDescription
objectthe device attributes

Examples

Getting the device attributes
JavaScript
import { Advertising } from '@firebolt-js/sdk'

Advertising.deviceAttributes()
.then(deviceAttributes => {
console.log(deviceAttributes)
})

Value of deviceAttributes

{}
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "advertising.deviceAttributes",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}

appBundleId

Get the App's Bundle ID

function appBundleId(): Promise<string>

Promise Resolution

TypeDescription
stringthe app bundle ID

Examples

Default Example
JavaScript
import { Advertising } from '@firebolt-js/sdk'

Advertising.appBundleId()
.then(appBundleId => {
console.log(appBundleId)
})

Value of appBundleId

"operator.app"
JSON-RPC
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "advertising.appBundleId",
"params": {}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "operator.app"
}

Schemas

AdPolicy

type AdPolicy = {
skipRestriction?: SkipRestriction // The advertisement skip restriction.
limitAdTracking?: boolean
}

Details

Describes various ad playback enforcement rules that the app should follow.


SkipRestriction

type SkipRestriction = 'none' | 'adsUnwatched' | 'adsAll' | 'all'

Details

The advertisement skip restriction.

Applies to fast-forward/rewind (e.g. trick mode), seeking over an entire opportunity (e.g. jump), seeking out of what's currently playing, and "Skip this ad..." features. Seeking over multiple ad opportunities only requires playback of the last opportunity, not all opportunities, preceding the seek destination.

ValueDescription
noneNo fast-forward, jump, or skip restrictions
adsUnwatchedRestrict fast-forward, jump, and skip for unwatched ad opportunities only.
adsAllRestrict fast-forward, jump, and skip for all ad opportunities
allRestrict fast-forward, jump, and skip for all ad opportunities and all content

Namespace: xrn:advertising:policy:skipRestriction:


AdConfigurationOptions

type AdConfigurationOptions = {
coppa?: boolean // Whether or not the app requires US COPPA compliance.
environment?: 'prod' | 'test' // Whether the app is running in a production or test mode.
authenticationEntity?: string // The authentication provider, when it is separate entity than the app provider, e.g. an MVPD.
}