VocSdkBase.h

Includes:
<Foundation/Foundation.h>
<UIKit/UIKit.h>

Introduction

Header file that defines the common parts that relate to all aspects of the SDK.



Functions

vocsdk_diag_get_log_level

Get the current diagnostic logging level.

vocsdk_diag_set_log_level

Controls the verbosity of the diagnostic messages in the console that VOC SDK will print.


vocsdk_diag_get_log_level


Get the current diagnostic logging level.

VOCSDK_EXPORT int vocsdk_diag_get_log_level(
    void);  
Return Value

int Returns the current diagnostic logging level.


vocsdk_diag_set_log_level


Controls the verbosity of the diagnostic messages in the console that VOC SDK will print.

VOCSDK_EXPORT void vocsdk_diag_set_log_level(
    int level);  
Discussion

Log levels are defined in LOG_LEVEL enum.


Constants

VOCSDKErrorDomain

Domain for errors coming out of Voc SDK.

VocSdkVersionBuild

Voc SDK release build number constant.

VocSdkVersionMajor

Voc SDK major build number constant.

VocSdkVersionMinor

Voc SDK minor build number constant.

VocSdkVersionString

Voc SDK build number string constant.


VOCSDKErrorDomain


Domain for errors coming out of Voc SDK.

VOCSDK_EXPORT NSString * const VOCSDKErrorDomain;  

VocSdkVersionBuild


Voc SDK release build number constant.

VOCSDK_EXPORT const int VocSdkVersionBuild;  

VocSdkVersionMajor


Voc SDK major build number constant.

VOCSDK_EXPORT const int VocSdkVersionMajor;  

VocSdkVersionMinor


Voc SDK minor build number constant.

VOCSDK_EXPORT const int VocSdkVersionMinor;  

VocSdkVersionString


Voc SDK build number string constant.

VOCSDK_EXPORT const unsigned char VocSdkVersionString[];  

Typedefs

NS_ENUM

Voc service states enumeration.

NS_ENUM

Item states enumeration.

NS_ENUM

File states enumeration.

NS_ENUM

VocObj type enumeration.

NS_ENUM

Content item type enumeration.

NS_ENUM

File type enumeration.

NS_ENUM

Item Download Behavior enumeration.

NS_ENUM

Current SDK network connection type enumeration.

NS_ENUM

User's preferred network selection type.

NS_ENUM

Type of download for a VocItem (shows how the download was initiated).

NS_ENUM

Network Quality enumeration.

NS_ENUM

Voc service error codes.

NS_OPTIONS

Download Policy Status enumeration.


NS_ENUM


Voc service states enumeration.

typedef NS_ENUM(NSInteger, VOCServiceState) { 
    VOCServiceStateNotRegistered = 0, VOCServiceStateInitializing = 
    1, VOCServiceStateIdle = 2, VOCServiceStateDownloading = 3 
};  
Constants
VOCServiceStateNotRegistered

VocService is not registered. This is the initial state.

VOCServiceStateInitializing

VocService is initializing. This is a transient state when service is starting up and still initializing, after that it will transtion to one of the other states.

VOCServiceStateIdle

VocService is registered and initialized and is not downloading at the moment.

VOCServiceStateIdle

VOCServiceStateIdle VocService is registered and initialized and is actively downloading at the moment.

See


NS_ENUM


Item states enumeration.

typedef NS_ENUM(NSInteger, VOCItemState) { 
    VOCItemMetadataNotReceived = 9, VOCItemDiscovered = 0, VOCItemQueued = 
    5, VOCItemDownloading = 1, VOCItemIdle = 6, VOCItemPaused = 7, VOCItemCached = 
    2, VOCItemFailed = 4, VOCItemDeleted = 3,  //deprecated mixed case aliases 
    VocItemQueued = VOCItemQueued, VocItemIdle = VOCItemIdle, VocItemPaused = 
    VOCItemPaused, VocItemFailed = VOCItemFailed, 
};  
Constants
VOCItemMetadataNotReceived

Item has been created locally. Waiting for metadata update from Server. If metadata update was not successful, the reason for failure can be found in VocItem::downloadError.

VOCItemDiscovered

IItem metadata has been received. Various device policies dictate whether the item gets queued for download.

VOCItemQueued

Item has been added to downloading queue, it is currently not downloading. It will start downloading.

VOCItemDownloading

Item is being downloaded.

VOCItemIdle

Item is currently not downloading. Item has been previously queued for downloading but did not finish. Download will resume automatically at some point. Reason for stopping download can be found in VocItem::downloadError .

VOCItemPaused

Item is currently not downloading. It has been explicitly paused with VocSerice pauseItems:.

VOCItemCached

Item download was completed successfully. Cached content is ready for use.

VOCItemFailed

If PCD SDK is unsuccessful to download any main content file after a number of attempts, the item will be marked as failed and the downloaded content will be removed. No more download attempts will be made on the item, unless an explicit download for this item is triggered again. VocItem::downloadError , can be used to verify the reason for download failure.

VOCItemDeleted

Item has been deleted and cannot be used any more. There are no cached files.

See


NS_ENUM


File states enumeration.

typedef NS_ENUM(NSInteger, VOCFileState) { 
    VOCFileDiscovered = 0, VOCFileDownloading = 1, VOCFileCached = 
    2, VOCFileFailed = 4, VOCFileNotCached = 5, VOCFileSkipDownload = 
    6, VOCFileIdle = 7 
};  
Constants
VOCFileDiscovered

File is not downloaded.

VOCFileDownloading

File is being downloaded.

VOCFileCached

File is downloaded.

VOCFileFailed

File handling by SDK such as downloading, saving etc. has resulted into an error.

VOCFileNotCached

File will not be downloaded due to configurations.

VOCFileIdle

File is currently not downloading. File has been queued for downloading before but did not finish downloading. Download will resume automatically at some point.


NS_ENUM


VocObj type enumeration.

typedef NS_ENUM(NSInteger, VOCObjType) { 
    VOCObjTypeItem = 0, VOCObjTypeItemCategory = 1, VOCObjTypeItemSource = 
    2, VOCObjTypeCount 
};  
Constants
VOCObjTypeItem

Content item type.

VOCObjTypeItemCategory

Category type.

VOCObjTypeItemSource

Source/Provider type.


NS_ENUM


Content item type enumeration.

typedef NS_ENUM(NSInteger, VOCItemTypeEnum) {  
    VOCItemTypeVideo = 0, VOCItemTypeGeneral = 8, VOCItemTypeCount 
};  
Constants
VOCItemTypeVideo

Video content.

VOCItemTypeGeneral

A type that can accomodate any content.


NS_ENUM


File type enumeration.

typedef NS_ENUM(int16_t, VocFileType) { 
    VOCUnknownFile = -1, VOCMainFile = 0,  // deprecated 
    VocUnknownFile = VOCUnknownFile, VocMainFile = VOCMainFile, 
};  
Constants
VOCUnknownFile

The type of the file cannot be determined.

VOCMainFile

main file is the one pointed by content item url, or one of the main file variants.


NS_ENUM


Item Download Behavior enumeration.

typedef NS_ENUM(NSInteger, VOCItemDownloadBehavior) { 
    VOCItemDownloadSdkBehavior = 0, VOCItemDownloadFullAuto = 1, VOCItemDownloadThumbnailOnly = 
    2, // unused 
    VOCItemDownloadNone = 3, VOCItemDownloadBehaviorCount 
};  
Constants
VOCItemDownloadSdkBehavior

VocItem::downloadBehavior means, this content item follows VocConfig::itemDownloadBehavior. VocConfig::itemDownloadBehavior should not have this value.

VOCItemDownloadFullAuto

If VocItem::downloadBehavior is VOCItemDownloadFullAuto, SDK downloads all the files of the content item. If VocConfig::itemDownloadBehavior is VOCItemDownloadFullAuto, SDK downloads all the files of the content item that has VocItem::downloadBehavior as VOCItemDownloadSdkBehavior.

VOCItemDownloadNone

If VocItem::downloadBehavior is VOCItemDownloadNone, SDK does not download any files associated with the content item. If VocConfig::itemDownloadBehavior is VOCItemDownloadNone, SDK does not download any files for the content item that has VocItem::downloadBehavior as VOCItemDownloadSdkBehavior.

Discussion

The value set on VocItem::downloadBehavior will override VocConfig::itemDownloadBehavior.


NS_ENUM


Current SDK network connection type enumeration.

typedef NS_ENUM(NSInteger, VOCConnectionType) { 
    VOCConnectionNone, VOCConnectionIsCellular, VOCConnectionIsWiFi, 
};  
Constants
VOCConnectionNone

There is no network connection.

VOCConnectionIsCellular

There is cellular network connection.

VOCConnectionIsWiFi

There is WiFi network connection.


NS_ENUM


User's preferred network selection type.

typedef NS_ENUM(NSInteger, VOCNetworkSelection) { 
    VOCNetworkSelectionInvalid = -1,//invalid selection from client end. 
    VOCNetworkSelectionNone = 0, VOCNetworkSelectionWifiOnly = 100, VOCNetworkSelectionWifiAndCellular = 
    101, 
};  
Constants
VOCNetworkSelectionNone

SDK should not use any network.

VOCNetworkSelectionWifiOnly

SDK downloads content over Wifi network.

VOCNetworkSelectionWifiAndCellular

SDK downloads content over Wifi network and if Wifi network is not available, SDK downloads content over Cellular network.


NS_ENUM


Type of download for a VocItem (shows how the download was initiated).

typedef NS_ENUM(NSInteger, VocDownloadType) { 
    VocDownloadTypeAuto = 0, VocDownloadTypeManual = 1, 
};  
Constants
VocDownloadTypeAuto

Download was initiated by SDK(Auto).

VocDownloadTypeManual

Download was initiated by user Application(Manually).


NS_ENUM


Network Quality enumeration.

typedef NS_ENUM(NSInteger, VocNetworkQualityStatus) { 
    VocNetworkQualityPoor = 0, VocNetworkQualityGood = 1, VocNetworkQualityExcellent = 
    2, VocNetworkQualityUnknown = -1, VocNetworkQualityNotReady = -2, 
};  
Constants
VocNetworkQualityPoor

If the network quality is below the lower threshold value.

VocNetworkQualityGood

If the network quality is between lower and higher threshold value.

VocNetworkQualityExcellent

If the network quality is above higher threshold value.

VocNetworkQualityUnknown

If the network quality cannot be determined by SDK.

VocNetworkQualityNotReady

If SDK is not ready yet to determine the network quality.

Discussion

Based on the threshold range that is given by the customer for each network type(say 2g, 3g, 4g etc), SDK calculates the network quality.


NS_ENUM


Voc service error codes.

Constants
VOCErrInvalidParam

An invalid parameter is passed to a call to voc service.

VOCErrCreateService

Creating VocService failed.

VOCErrAlreadyRegistered

SDK is already registered or is in the process of registeration .

VOCErrNotRegistered

SDK is not registered or was logged out, need to register.

VOCErrRegisterFailedBadCredentials

SDK failed to register due to bad credentials.

VOCErrRegisterFailedOther

SDK failed to register for some other reason than bad credentials, network connection might not be available.

VOCErrDb

Database Error.

VOCErrServerApiError

Server API Error.

VOCErrServerApiErrorUnauthorized

Server request from SDK was responded with unauthorized access error.

VOCErrServerApiErrorRequestFailed

Server request from SDK got failed.

VOCErrServerApiErrorResponseParse

Client failed to parse the server response.

VOCErrServerApiErrorResponseData

Server response data is having error.

VOCErrServerApiErrorNotAllowed

The API is not allowed for the registered SDK type.

VocErrCancelled

Operation cancelled internally or due to unknown issue.

VocErrUserCancelled

Operation cancelled externally by the client. This could happen when API is called to pause a download, delete an item or to cancel all downloads.

VocErrTimeOut

Operation was cancelled because it did not finish in the allocated time.

VocErrBackgroundTimeOver

Operation was cancelled because background execution time finished.

VocErrDownloadOptimization

Download operation not started or was cancelled in order to optimize downloads.

VOCErrDownloadAlreadyInProgress

Download operation not started or was cancelled because there is another download operation in progress.

VOCErrDownloadOutOfPolicy

Download operation not started or was cancelled because download policy does not allow downloads at the moment.

VOCErrDownloadNetworkCongested

Download operation not started or was cancelled because network is congested.

VOCErrDownloadDailyLimit

Download operation not started or was cancelled because daily download limit was reached.

VOCErrDownloadCacheLimit

Download operation not started or was cancelled because cache limit was reached.

VocErrShuttingDown

Operation was cancelled because voc service is shutting down.

VocErrCongestionCheckFailed

Congestion check failed for unspecified reason.

VocErrItemDeletionFailed

VocItem deletion failed.

VocErrItemNotFound

VocItem not found either locally or in server.

VocErrDownloadedItemImportFailed

VocItem Local file Import failed.

VocErrDownloadNetworkError

Network is not available for download or the network policy restricts the download.

VocErrDownloadItemCorrupted

VocItem download failed, SDK cannot parse and process item.

VocErrCongestionCheckFailed404

Congestion check failed because of 404 response.

VocErrRegistrationDelayed

Registration got cancelled because it is configured for delayed registration.

VocErrDownloadHttpError

Download failed due to http errors other than VocErrTimeOut.

VOCErrContentIdDoesNotExistInServer

Item requested for download does not have metadata available in PCD Server.

VOCErrDownloadLaterLimit

Items queued for download later has reached the maximum limit set in VocConfig::maxLaterDownloads.

VocErrMaxConcurrentDownloadLimit

Number of items downloading has reached VocConfig::maxConcurrentDownloads.


NS_OPTIONS


Download Policy Status enumeration.

Constants
VOCPolicyStatusInPolicy

SDK meets all the policies and can download.

VOCPolicyStatusNotRegistered

SDK is not registered and cannot download.

VOCPolicyStatusNoDownload

Policy does not allow SDK to download.

VOCPolicyStatusWifiDisallowedOnBattery

Policy disallows SDK to download when device is not charging.

VOCPolicyStatusWifiNotAllowed

Policy disallows SDK to download when in wifi.

VOCPolicyStatusHostUnreachableViaWifi

Host is unreachable via wifi.

VOCPolicyStatusCellularDisallowedOnBattery

Policy disallows SDK to download when device is on a cellular connection and it is not charging.

VOCPolicyStatusCellularTimeOfDay

Time of Day policy disallows SDK to use cellular network for download.

VOCPolicyStatusCellularNotAllowed

Network policy disallows SDK to use cellular network for download.

VOCPolicyStatusHostUnreachableViaCellular

Host is unreachable via cellular.

VOCPolicyStatusBatteryTooLow

Current device battery level is lower than required by battery policy.


Enumerated Types

DownloadQuota

Download quota enumeration.

int

A list of log level customer can set.

int64_t

Download quota enumeration.

LOG_LEVEL

A list of log level customer can set.


DownloadQuota


Download quota enumeration.

enum : int64_t {  
    VOCDownloadQuotaUnlimited = INT64_MAX 
};  
Constants
VOCDownloadQuotaUnlimited

The value for unlimited download quota.

See Also


int


A list of log level customer can set.

Constants
VOCSDK_DIAG_LOG_LEVEL_NONE

Prints nothing.

VOCSDK_DIAG_LOG_LEVEL_LOW

Prints Errors.

VOCSDK_DIAG_LOG_LEVEL_HIGH

Prints Errors and Warnings.

See Also


int64_t


Download quota enumeration.

enum : int64_t {  
    VOCDownloadQuotaUnlimited = INT64_MAX 
};  
Constants
VOCDownloadQuotaUnlimited

The value for unlimited download quota.

See Also


LOG_LEVEL


A list of log level customer can set.

Constants
VOCSDK_DIAG_LOG_LEVEL_NONE

Prints nothing.

VOCSDK_DIAG_LOG_LEVEL_LOW

Prints Errors.

VOCSDK_DIAG_LOG_LEVEL_HIGH

Prints Errors and Warnings.

See Also

int