initWithAppInfo:delegate:: Difference between revisions

From Engineering Client Portal

No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 12: Line 12:
== Init JSON ==
== Init JSON ==
* Call <code>initWithAppInfo:delegate:</code> to initialize a Nielsen App SDK object.
* Call <code>initWithAppInfo:delegate:</code> to initialize a Nielsen App SDK object.
** This API requires Core Location service.
* The complete list of arguments that can be passed via the AppInfo JSON schema for the API are as follows.
* The compelte 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.
** The appid is provided by the Nielsen Technical Account Manager (TAM). The appid is a GUID data type and is specific to the application.
{| class="wikitable"
{| class="wikitable"
Line 23: Line 22:
* Use Production appid to submit app to App / Play store, after receiving Nielsen certification.
* Use Production appid to submit app to App / Play store, after receiving Nielsen certification.
|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|| Nielsen-specified || Yes || PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|-
| appname || Name of the application || Client-defined || Yes || Nielsen Sample App
|-
| appversion || Current version of the app used || SDK generated || Yes || "1.0.2"
|-
|-
| sfcode || Nielsen collection facility to which the SDK should connect.
| sfcode || Nielsen collection facility to which the SDK should connect.
'''DTVR'''
'''DTVR'''
* "us" for production
* "us" for production
'''Digital Audio'''
* "drm" for production
'''DCR'''
'''DCR'''
* "dcr" for production
* "dcr" for production
Line 44: Line 37:
|-
|-
| ccode || If Country Code is provided by the app, it should be done after consultation with the Technical Account Manager. || Client-defined || No || 456
| 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&
|}
|}


Line 60: Line 67:
** '''DEBUG''': Debug logs, used by the developers to debug more complex issues.
** '''DEBUG''': Debug logs, used by the developers to debug more complex issues.


'''Example'''
{{iOS_init_example}}
<syntaxhighlight lang="swift">NSDictionary* appInformation = @
        {
            @"appid": @"appid",
            @"appname": @"appname",
            @"appversion": @"2.0"
            @"sfcode": @"sfcode",
            @"nol_devDebug": @"INFO"
        };
nlsAppApiMeter = [[NielsenAppApi alloc] initWithAppInfo:appInformation delegate:self];</syntaxhighlight>


Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.
Once the flag is active, it logs each API call made and the data passed. The log created by this flag is minimal.
Line 86: Line 84:
   @"sfcode": @"dcr",
   @"sfcode": @"dcr",
   @"appid": @"PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
   @"appid": @"PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  @"appname": @"Nielsen SDK Sample QA",
  @"appversion": @"2.0"
}</syntaxhighlight>
}</syntaxhighlight>
|-
|-
Line 94: Line 90:
   @"sfcode": @"dcr",
   @"sfcode": @"dcr",
   @"appid": @"PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
   @"appid": @"PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  @"appname": @"Nielsen SDK Sample QA",
  @"appversion": @"2.0"
   @"longitude": @"123.22",
   @"longitude": @"123.22",
   @"latitude": @"-223.32",
   @"latitude": @"-223.32",

Latest revision as of 19:49, 10 May 2023

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"
}