This document aims at presenting the objects and methods available in the mobile SDK to mannage content from the Adtag Platform

Pre-requisites

Prior to going through this document, we recommend that you:

  • make sure you have access to the Adtag Platform
  • have a tutorial application installed on your device to perform live tests with the illustrative code that follows
  • have completed the "Adtag data model" tutorial

Accessing Adtag content from the mobile SDK

The SDK allows users to access content on Adtag through two objects: adtagContent and beaconContent. Both contain methods to retrieve information.

  • AdtagContent: generic methods to retrieve information for any point & technology (NFC tags / QRC / beacons).

  • BeaconContent: BeaconContent extends AdtagContent and has specific, build-in methods to retrieve beacon information more easily. These methods enable developers to retrieve information from the following beacon-specific categories:

    • the beacon-notification category, which includes the content of beacon notifications
    • the beacon-alert category, which includes the content of beacon alerts

Accessing the content of a category using the AdtagContent object

The AdtagContent object provides several methods to access the fields of a category, depending on their type. These methods can also be used with the BeaconContent object.

Accessing a String field

Android

AdtagContent.getValue(CATEGORY_NAME, FIELD_NAME)

For example:

adtagContent.getValue("beacon-notification", "title")

allows to retrieve the field title from the category beacon-notification.

iOs

AdtagContent.getValueFromCategory:CATEGORY_NAME andField:FIELD_NAME

For example:

adtagContent.getValueFromCategory:@"beacon-notification" andField:@"title"

allows to retrieve the field title from the category beacon-notification.

Accessing to a Multimedia field

Android

AdtagContent.getMultimedia(CATEGORY_NAME, FIELD_NAME)

allows to retrieve the URL to download or read multimedia content (images, videos, audio files) from the Adtag Platform.

iOs

AdtagContent.getMultimediaFromCategory:CATEGORY_NAME andField:FIELD_NAME

allows to retrieve the URL to download or read multimedia content (images, videos, audio files) from the Adtag Platform.

Accessing a Boolean field

Android

AdtagContent.getBoolean(CATEGORY_NAME, FIELD_NAME)

allows to retrieve a boolean for a FIELD_NAME and CATEGORY_NAME.

iOs

AdtagContent.getBooleanFromCategory:CATEGORY_NAME andField:FIELD_NAME

allows to retrieve a boolean for a FIELD_NAME and CATEGORY_NAME.

Test if a field is empty

Android

AdtagContent.isEmpty(CATEGORY_NAME, FIELD_NAME)

retrieves "true" if the FIELD_NAME for the CATEGORY_NAME is empty.

iOs

AdtagContent.isEmptyFromCategory:CATEGORY_NAME andField:FIELD_NAME

retrieves "true" if the FIELD_NAME for the CATEGORY_NAME is empty.