Miscellaneous

Errors and Exceptions


SNRError

Note: The default error domain for SDK errors is SNRErrorDomain.

Declared In:
Headers/SNRError.h

Inherits From:
NSError

Conforms To:
NSCopying
NSSecureCoding

Declaration:

class SNRError: NSError

There are global string constants that can be used to get specific information from the userInfo property:

  • SNRErrorUserInfoCodeKey
  • SNRErrorUserInfoTitleKey
  • SNRErrorUserInfoMessageKey
  • SNRErrorUserInfoFieldKey
  • SNRErrorUserInfoPathKey
  • SNRErrorUserInfoRejectedValueKey
  • SNRErrorUserInfoErrorsKey


SNRApiError

Note: The default error domain for the SDK errors is the SNRErrorDomain global constant.

Declared In:
Headers/SNRApiError.h

Inherits From:
SNRError

Conforms To:
NSCopying
NSSecureCoding

Declaration:

class SNRApiError: SNRError

Properties:

Property Type Optional Description
errors [SNRError] yes List of error items

Initializers:

init(domain: String, code: Int, userInfo: [String: Any]?, errors: [SNRError]?)

Methods:

This method retrieves the type of an error (SNRApiErrorType).

func getType() -> SNRApiErrorType


This method retrieves the HTTP code of an error.

func getHttpCode() -> Int


This method retrieves the internal code of an error.

func getErrorCode() -> String?


This method retrieves the description of an error.

func getBody() -> String?



SNRApiErrorType

Declared In:
Headers/SNRApiError.h

Declaration:

enum SNRApiErrorType: Int {
	unknown,
	network,
	unauthorizedSession,
	http
}



SNRException

Declared In:
Headers/SNRException.h

Inherits From:
NSException

Conforms To:
NSCopying

Declaration:

class SNRException: NSException

Properties:

Property Type Optional Description
error SNRError no Error provided for Swift compatibility

Methods:

Throws an exception.

static func throwException(exceptionName: NSExceptionName, reason: String)



SNRInvalidArgumentException

Declared In:
Headers/SNRInvalidArgumentException.h

Inherits From:
SNRException

Conforms To:
NSCopying

Declaration:

class SNRInvalidArgumentException: NSException



CacheManager

Declared In:
Headers/SNRCacheManager.h

Declaration:

class CacheManager: NSObject

Methods:

static func get(_: AnyClass) -> AnyObject


Misc


HostApplicationType

Declared In:
Headers/SNRHostApplicationType.h

Declaration:

enum HostApplicationType: Int {
	unknown,
	native,
	reactNative,
	flutter,
	xamarin,
	other
}

Functions:

Converts from HostApplicationType to String.

func SNR_HostApplicationTypeToString(_: HostApplicationType) -> String


Converts from String to HostApplicationType.

func SNR_StringToHostApplicationType(_: String) -> HostApplicationType



BaseModel

Declared In:
Headers/SNRBaseModel.h

Inherits From:
NSObject

Declaration:

class BaseModel: NSObject



ApiQuerySortingOrder

Declared In:
Headers/SNRApiQuerySortingOrder.h

Declaration:

enum ApiQuerySortingOrder: Int {
	ascending,
	descending
}

Functions:

Converts from ApiQuerySortingOrder to String.

func SNR_ApiQuerySortingOrderToString(_: ApiQuerySortingOrder) -> String


Converts from String to ApiQuerySortingOrder.

func SNR_StringToApiQuerySortingOrder(_: String) -> ApiQuerySortingOrder

Note:

The following string constants can be used in API Query objects:

  • SNR_API_QUERY_SORTING_ASC
  • SNR_API_QUERY_SORTING_DESC


ScreenViewApiQuery

The object to set parameters easily for fetching screen views from API.

Declared In:
Headers/SNRScreenViewApiQuery.h

Inherits From:
NSObject

Declaration:

class ScreenViewApiQuery: NSObject

Properties:

Property Type Optional Default Description
feedSlug String no nil Identifies a specific screen view feed
productID String yes nil Item identifier

Initializers:

init(feedSlug: String, productID: String?)



ScreenView

Declared In:
Headers/SNRScreenView.h

Related To:
ScreenViewAudienceInfo

Inherits From:
BaseModel

Declaration:

class ScreenView: BaseModel

Properties:

Property Type Optional Description
identifier String no Screen View’s ID
name String no Screen View’s name
hashString String no Screen View’s hash
path String no URL of the screen view’s definition
priority Int no Screen View’s priority (1-99, where 1 is the highest)
audience ScreenViewAudienceInfo no Audience of a Screen View
data AnyObject no Content of the screen view
createdAt Date no Screen View’s creation date
updatedAt Date no Screen View’s update date
Important: All properties are read-only.


ScreenViewAudienceInfo

Declared In:
Headers/SNRScreenViewAudience.h

Related To:
ScreenView

Inherits From:
BaseModel

Declaration:

class ScreenViewAudienceInfo: BaseModel

Properties:

Property Type Optional Description
segments [String] yes Audience’s segments
query String yes Audience’s query
targetType String yes Audience’s target type
Important: All properties are read-only.


ScreenViewResponse

Declared In:
Headers/SNRScreenViewResponse.h

Related To:
ScreenViewAudience

Inherits From:
BaseModel

Declaration:

class ScreenViewResponse: BaseModel

Properties:

Property Type Optional Description
audience ScreenViewAudience no Audience of a screen view
identifier String no Screen view’s ID
hashString String no Screen view’s hash
path String no URL of the screen view’s definition
name String no Screen view’s name
priority NSNumber no Screen View’s priority (1-99, where 1 is the highest)
descriptionText String yes Screen view’s description
data AnyObject no Content of the screen view
version String no Version of a screen view
parentVersion String yes Parent version of a screen view
createdAt Date no Screen view’s creation date
updatedAt Date no Screen view’s update date
deletedAt Date yes Screen view’s deletion date
Important: All properties are read-only.


ScreenViewAudience

Declared In:
Headers/SNRScreenViewAudience.h

Related To:
ScreenViewResponse

Inherits From:
BaseModel

Declaration:

class ScreenViewAudience: BaseModel

Properties:

Property Type Optional Description
IDs [String] yes Audience’s identifiers
query String yes Audience’s query
Important: All properties are read-only.


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker