Miscellaneous

Errors and Exceptions


SNRError

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
@interface 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

This method retrieves the HTTP code of an error.

func getHttpCode() -> Int
- (NSInteger)getHttpCode

This method retrieves the internal code of an error.

func getErrorCode() -> String?
- (nullable NSString *)getErrorCode

This method retrieves the description of an error.

func getBody() -> String?
- (nullable NSString *)getBody


SNRApiErrorType

Declared In:
Headers/SNRApiError.h

Declaration:

enum SNRApiErrorType: Int {
    unknown,
    network,
    unauthorizedSession,
    http
}
typedef NS_ENUM(NSInteger, SNRApiErrorType) {
    SNRApiErrorTypeUnknown,
    SNRApiErrorTypeNetwork,
    SNRApiErrorTypeUnauthorizedSession,
    SNRApiErrorTypeHttp
};


SNRException

Declared In:
Headers/SNRException.h

Inherits From:
NSException

Conforms To:
NSCopying

Declaration:

class SNRException: NSException
@interface 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)
+ (void)throwException:(NSExceptionName)exceptionName reason:(nonnull NSString *)reason


SNRInvalidArgumentException

Declared In:
Headers/SNRInvalidArgumentException.h

Inherits From:
SNRException

Conforms To:
NSCopying

Declaration:

class SNRInvalidArgumentException: NSException
@interface SNRInvalidArgumentException : NSException


CacheManager

Declared In:
Headers/SNRCacheManager.h

Declaration:

class CacheManager: NSObject
@interface SNRCacheManager : NSObject

Methods:

static func get(_: AnyClass) -> AnyObject
+ (nullable id)get:(Class)aClass


Misc


HostApplicationType

Declared In:
Headers/SNRHostApplicationType.h

Declaration:

enum HostApplicationType: Int {
    unknown,
    native,
    reactNative,
    flutter,
    xamarin,
    other
}
typedef NS_ENUM(NSUInteger, SNRHostApplicationType) {
    SNRHostApplicationTypeUnknown,
    SNRHostApplicationTypeNative,
    SNRHostApplicationTypeReactNative,
    SNRHostApplicationTypeFlutter,
    SNRHostApplicationTypeXamarin,
    SNRHostApplicationTypeOther
}

Functions:

Converts from HostApplicationType to String.

func SNR_HostApplicationTypeToString(_: HostApplicationType) -> String
NSString * SNR_HostApplicationTypeToString(SNRHostApplicationType type)

Converts from String to HostApplicationType.

func SNR_StringToHostApplicationType(_: String) -> HostApplicationType
SNRHostApplicationType SNR_StringToHostApplicationType(NSString * _Nullable string)


BaseModel

Declared In:
Headers/SNRBaseModel.h

Inherits From:
NSObject

Declaration:

class BaseModel: NSObject
@interface SNRBaseModel : NSObject


ApiQuerySortingOrder

Declared In:
Headers/SNRApiQuerySortingOrder.h

Declaration:

enum ApiQuerySortingOrder: Int {
    ascending,
    descending
}
typedef NS_ENUM(NSUInteger, SNRApiQuerySortingOrder) {
    SNRApiQuerySortingOrderAscending,
    SNRApiQuerySortingOrderDescending
}

Functions:

Converts from ApiQuerySortingOrder to String.

func SNR_ApiQuerySortingOrderToString(_: ApiQuerySortingOrder) -> String
NSString * SNR_ApiQuerySortingOrderToString(SNRApiQuerySortingOrder type)

Converts from String to ApiQuerySortingOrder.

func SNR_StringToApiQuerySortingOrder(_: String) -> ApiQuerySortingOrder
SNRApiQuerySortingOrder SNR_StringToApiQuerySortingOrder(NSString * _Nullable string)

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
@interface SNRScreenViewApiQuery : NSObject

Properties:

Property Type Optional Default Description
feedSlug String no nil Identifies a specific screen view feed
productID String yes nil Item identifier
params [String: Any] yes nil Additional parameters to pass for Inserts in the screen view. For example, if the insert is {{ foo }}, you need to pass the value of foo

Initializers:

init(feedSlug: String, productID: String?)
- (instancetype)initWithFeedSlug:(NSString *)feedSlug productID:(nullable NSString *)productID


ScreenView

Declared In:
Headers/SNRScreenView.h

Related To:
ScreenViewAudienceInfo

Inherits From:
BaseModel

Declaration:

class ScreenView: BaseModel
@interface SNRScreenView : SNRBaseModel

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

All properties are read-only.



ScreenViewAudienceInfo

Declared In:
Headers/SNRScreenViewAudience.h

Related To:
ScreenView

Inherits From:
BaseModel

Declaration:

class ScreenViewAudienceInfo: BaseModel
@interface SNRScreenViewAudienceInfo : SNRBaseModel

Properties:

Property Type Optional Description
segments [String] yes Audience's segments
query String yes Audience's query
targetType String yes Audience's target type

All properties are read-only.



BrickworksApiQuery

Object responsible for creating a query to the Brickworks API.

Declared In:
Headers/SNRBrickworksApiQuery.h

Inherits From:
NSObject

Declaration:

class BrickworksApiQuery: NSObject
@interface SNRBrickworksApiQuery : NSObject

Properties:

Property Type Optional Description
schemaSlug String no Unique identifier (appName/API name) of a schema
recordSlug String yes1 Unique identifier (slug/slug) of a record
recordId String yes1 Unique identifier (id/UUID) of a record
context Object yes Key/value properties for {{ context.keyName }} inserts in the record
fieldContext Object yes Additional properties for recommendation and many-to-one field types

Initializers

You can use the record slug or ID.

init(schemaSlug: String, recordSlug: String)

init(schemaSlug: String, recordId: String)

You can use the record slug or ID.

(instancetype)initWithSchemaSlug:(NSString *)schemaSlug recordSlug:(NSString *)recordSlug

(instancetype)initWithSchemaSlug:(NSString *)schemaSlug recordId:(NSString *)recordId


Removed symbols


ScreenViewResponse

Declared In:
Headers/SNRScreenViewResponse.h

Related To:
ScreenViewAudience

Inherits From:
BaseModel

Declaration:

class ScreenViewResponse: BaseModel
@interface SNRScreenViewResponse : SNRBaseModel

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

All properties are read-only.



ScreenViewAudience

Declared In:
Headers/SNRScreenViewAudience.h

Related To:
ScreenViewResponse

Inherits From:
BaseModel

Declaration:

class ScreenViewAudience: BaseModel
@interface SNRScreenViewAudience : SNRBaseModel

Properties:

Property Type Optional Description
IDs [String] yes Audience's identifiers
query String yes Audience's query

All properties are read-only.

Canonical URL: https://hub.synerise.com/developers/mobile-sdk/class-reference/ios/miscellaneous