initWithAppInfo:delegate:

From Engineering Client Portal

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Engineering Portal breadcrumbArrow.png Digital breadcrumbArrow.png iOS SDK API Reference breadcrumbArrow.png initWithAppInfo:delegate:

Syntax

 (instancetype)initWithAppInfo:(id)appInfo delegate:(id)delegate;

Here, appInfo is a JSON formatted string or NSDictionary object that includes identification of the app.

Init JSON

  • Call initWithAppInfo:delegate: to initialize a Nielsen App SDK object.
  • The complete list of arguments that can be passed via the AppInfo JSON schema for the API are as follows.
    • The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.
Parameter / Argument Description Source Required? Example
appid Unique id for the application assigned by Nielsen. It is GUID data type.
  • Use Test appid during development, test, and certification processes
  • Use Production appid to submit app to App / Play store, after receiving Nielsen certification.
Nielsen-specified Yes PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
sfcode Nielsen collection facility to which the SDK should connect.

DTVR

  • "us" for production

DCR

  • "dcr" for production
Nielsen-specified Yes dcr
longitude This value will not be overwritten by SDK for International (Germany). Client-defined No 123.22
latitude This value will not be overwritten by SDK for International (Germany). Client-defined No -123.22
dma Nielsen Designated Market Area code. DMA must be the Nielsen DMA value. Please check with the Technical Account Manager. Client-defined No 123
ccode If Country Code is provided by the app, it should be done after consultation with the Technical Account Manager. Client-defined No 456
hem_sha256 SHA256-hashed email address (client-supplied unique 32-character hexadecimal string) Client-defined No tMmiiTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ=
hem_sha1 SHA1-hashed email address (client-supplied unique 32-character hexadecimal string) Client-defined No XvBniTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ=
hem_md5 MD5-hashed email address (client-supplied unique 32-character hexadecimal string) Client-defined No JnIbdTI7IaAcPpQPFQ65uMVCWH8av9jw4cwf/F5HVRQ=
uid2 An identifier based on a user’s verifiable PII (e.g. hashed email). UID2.0 was initially created by The Trade Desk (TTD) and is now managed by Prebid. Client-defined No MTKVpUAzwYAPnHrtfE0wlINOMzhU7UUEjjVdCdRu63k=
uid2_token Encrypted Unified ID 2.0 Client-defined No AgAAAAPFR0zA5ogv/yaAPiUsAdZPsfqS8Ql

DSGxAB+rr8yekFs3AjLYVk5qqqiyV2XHbSuwzHmxSlLeQeK QI1mp015jsNnpX5/xGgXldcgVz+gFnyh3T8/3agMwRmyrhC xG4oH2C7fc48AQk2eotE7FW0ZDEYM8fD9ZxDaxFUC/OV3OuZA&

Return Values

The application should check for valid return values like:

  • Initialized NielsenAppApi object of type id.
  • NIL object, if the initialization failed

Note: The minimum version supported by SDK is iOS 7. The app may not compile or the call to initWithAppInfo:delegate: will fail if Nielsen App SDK is initialized on devices with iOS versions 6.x and earlier.

Debug flag for development environment

Player application developers / integrators can use Debug flag to check whether an App SDK API call made is successful. To activate the Debug flag,

  • Pass the argument @"nol_devDebug":@"INFO", in the JSON string for initWithAppInfo:delegate:, as below. The permitted values are
    • INFO: Displays the API calls and the input data from the application (validate player name, app ID, etc.). It can be used as certification Aid.
    • WARNING: Indicates potential integration / configuration errors or SDK issues.
    • ERROR: Indicates important integration errors or non-recoverable SDK issues.
    • DEBUG: Debug logs, used by the developers to debug more complex issues.

Example

NSDictionary* appInformation = @
         {
            @"sfcode": @"dcr",
            @"appid": @"PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
            @"hem_MD5": @"dea036a534e3cfb72cb786d48eae0fd4",
            @"hem_sha1": @"7e77fc5552938f67f5071ce99ec0cb058c2b1c7c",
            @"hem_sha256": @"e46f3f2c8c0e1d509aeb04d2fd78f0481c8520cb6769c258a50ddb98b073dabc",
            @"uid2": @"MTKVpUAzwYAPnHrtfE0wlINOMzhU7UUEjjVdCdRu63k=",
            @"uid2_token": @"AgAAAAPFR0zA5ogv/yaAPiUsAdZPsfqS8Ql
DSGxAB+rr8yekFs3AjLYVk5qqqiyV2XHbSuwzHmxSlLeQeK QI1mp015jsNnpX5/xGgXldcgVz+gFnyh3T8/3agMwRmyrhC xG4oH2C7fc48AQk2eotE7FW0ZDEYM8fD9ZxDaxFUC/OV3OuZA&",
            @"nol_devDebug": @"INFO"
         };
nlsAppApiMeter = [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:self];

Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.

Note: DO NOT activate the Debug flag in a production environment.

Sequence Diagram

Sequence-video-radio.jpg

Examples

SDK init JSON call Example
JSON with basic application information
NSDictionary *appInformation = @
{
   @"sfcode": @"dcr",
   @"appid": @"PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
}
JSON with optional Longitude and Latitude
NSDictionary *appInformation = @
{
   @"sfcode": @"dcr",
   @"appid": @"PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
   @"longitude": @"123.22",
   @"latitude": @"-223.32",
   @"dma": @"123",
   @"ccode": @"456"
}