Content

Generate document


This method generates the document that is defined for the provided slug. Inserts are processed.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.13.0 5.5.0 0.17.0 0.6.0

The API key must have the SCHEMA_SERVICE_SCHEMA_READ permission from the Schema group.

Declared In:
Headers/SNRContent.h

Related To:
Document

Class:
Content

Declaration:

static func generateDocument(slug: String, success: ((Document) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)generateDocument:(NSString *)slug success:(nonnull void (^)(SNRDocument *document))success failure:(nonnull void (^)(NSError *error))failure

Parameters:

Parameter Type Mandatory Default Description
slug String yes - Slug of the document
success ((Document) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value: No value is returned.

Example:

let slug = "similar"
Content.generateDocument(slug: slug, success: { document in
  // success
}) { error in
  // failure
}
NSString *slug = @"similar";
[SNRContent generateDocument:slug success:^(NSDictionary *document) {
  // success
} failure:^(SNRApiError *error) {
  // failure
}]

Generate document with query parameters


This method generates the document that is defined for the parameters provided in the query object.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.18.0 5.19.0 0.22.0 1.2.0

The API key must have the SCHEMA_SERVICE_SCHEMA_READ permission from the Schema group.

Declared In:
Headers/SNRContent.h

Related To:
DocumentApiQuery
Document

Class:
Content

Declaration:

static func generateDocument(apiQuery: DocumentApiQuery, success: ((Document) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)generateDocumentWithApiQuery:(SNRDocumentApiQuery *)apiQuery success:(void (^)(SNRDocument *document))success failure:(void (^)(SNRApiError *error))failure

Parameters:

Parameter Type Mandatory Default Description
apiQuery DocumentApiQuery yes - Object that stores all query parameters
success ((Document) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value: No value is returned.

Get recommendations (v2)


This method generates recommendations that are defined for the options provided. The recommendations are generated by using a document with an insert.

For instructions, see "Displaying AI recommendations > With documents and screen views".

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.13.0 5.5.0 0.17.0 0.6.0

The API key must have the SCHEMA_SERVICE_SCHEMA_READ permission from the Schema group.

Declared In:
Headers/SNRContent.h

Related To:
RecommendationOptions
RecommendationResponse

Class:
Content

Declaration:

static func getRecommendationsV2(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)getRecommendationsV2:(SNRRecommendationOptions *)options success:(nullable void (^)(SNRRecommendationResponse *recommendationResponse))success failure:(nullable void (^)(NSError *error))failure

Parameters:

Parameter Type Mandatory Default Description
options RecommendationOptions yes - Options for recommendations
success ((RecommendationResponse) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value:
No value is returned.

Example:

let options: RecommendationOptions = RecommendationOptions()
options.slug = "similar"
options.productID = "1"
Content.getRecommendationsV2(options: options, success: { (recommendationResponse) in
  // success
}) { (error) in
  // failure
}
SNRRecommendationOptions *options = [SNRRecommendationOptions new];
options.slug = @"similar";
options.productID = "1";
[SNRContent getRecommendationsV2:options success:^(SNRRecommendationResponse *recommendationResponse) {
  // success
} failure:^(SNRApiError *error) {
  // failure
}]

Generate screen view


This method generates a customer's highest-priority screen view campaign from the feed with the provided feed slug.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.13.0 5.5.0 0.17.0 0.6.0

The API key must have the SCHEMA_SERVICE_SCHEMA_READ permission from the Schema group.

Declared In:
Headers/SNRContent.h

Related To:
ScreenView

Class:
Content

Declaration:

static func generateScreenView(feedSlug: String, success: ((ScreenView) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)generateScreenView:(NSString *)feedSlug success:(nonnull void (^)(SNRScreenView *screenView))success failure:(nonnull void (^)(SNRApiError *error))failure

Parameters:

Parameter Type Mandatory Default Description
feedSlug String yes - Identifies a specific screen view feed
success ((ScreenView) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value:
No value is returned.

Generate screen view with query parameters


This method generates customer's highest-priority screen view campaign that is defined for parameters provided in the query object. Declared In:
Headers/SNRContent.h

Related To:
ScreenViewApiQuery
ScreenView

Class:
Content

Declaration:

static func generateScreenView(apiQuery: ScreenViewApiQuery, success: ((ScreenView) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)generateScreenViewWithApiQuery:(SNRScreenViewApiQuery *)apiQuery success:(void (^)(SNRScreenView *screenView))success failure:(void (^)(SNRApiError *error))failure

Parameters:

Parameter Type Mandatory Default Description
apiQuery ScreenViewApiQuery yes - Object that stores all query parameters
success ((ScreenView) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value:
No value is returned.

Generate Brickworks


This method generates content from a published version of a Brickworks record. Inserts and fields which require a customer context fetch it automatically from the current user.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 5.8.1 6.8.0 1.6.0 2.6.0

The API key must have the BRICKWORKS_RECORDS_READ permission from the RECORDS group.

Declared In:
Headers/SNRContent.h

Related To:
BrickworksApiQuery

Class:
Content

Declaration:

static func generateBrickworks(apiQuery: BrickworksApiQuery, success: (([String: Any]) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)generateBrickworks:(SNRBrickworksApiQuery *)apiQuery success:(void (^)(NSDictionary *))success failure:(void (^)(SNRApiError *error))failure

Parameters:

Parameters:

Parameter Type Mandatory Default Description
apiQuery BrickworksApiQuery yes - Object that stores all query parameters
success () -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value:
Object with content generated from a record.

Removed methods

Get document


This method generates the document that is defined for the provided slug.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 3.4.8 3.4.2 0.9.10 0.2.0
Deprecated in: 4.13.0 5.5.0 0.17.0 0.6.0
Removed in: 5.0.0 6.0.0 1.0.0 2.0.0

The API key must have the SCHEMA_SERVICE_DOCUMENT_READ permission from the Document group.

Replaced By:
Generate document and Generate document with query parameters

Declared In:
Headers/SNRContent.h

Class:
Content

Declaration:

static func getDocument(slug: String, success: (([AnyHashable: Any]) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)getDocument:(NSString *)slug success:(nonnull void (^)(NSDictionary *document))success failure:(nonnull void (^)(NSError *error))failure

Parameters:

Parameter Type Mandatory Default Description
slug String yes - Slug of the document
success (([AnyHashable: Any]) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value: No value is returned.

Example:

let slug = "similar"
Content.getDocument(slug: slug, success: { document in
  // success
}) { error in
  // failure
}
NSString *slug = @"similar";
[SNRContent getDocument:slug success:^(NSDictionary *document) {
  // success
} failure:^(SNRApiError *error) {
  // failure
}]

Get documents


This method generates documents that are defined for parameters provided in the query object.

iOS SDK Android SDK React Native SDK Flutter SDK
Removed in: 5.0.0 6.0.0 1.0.0 2.0.0

The API key must have the SCHEMA_SERVICE_DOCUMENT_READ permission from the Document group.

Declared In:
Headers/SNRContent.h

Related To:
DocumentsApiQuery

Class:
Content

Declaration:

static func getDocuments(apiQuery: DocumentsApiQuery, success: (([[AnyHashable: Any]]) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)getDocumentsWithApiQuery:(SNRDocumentsApiQuery *)apiQuery success:(nonnull void (^)(NSArray *documents))success failure:(nonnull void (^)(NSError *error))failure

Parameters:

Parameter Type Mandatory Default Description
apiQuery DocumentsApiQuery yes - Object that stores all query parameters
success (([[AnyHashable: Any]]) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value:
No value is returned.

Get recommendations


This method generates recommendations that are defined for the options provided.

iOS SDK Android SDK React Native SDK Flutter SDK
Removed in: 5.0.0 6.0.0 1.0.0 2.0.0

The API key must have the SCHEMA_SERVICE_DOCUMENT_READ permission from the Document group.

Replaced By:
Get recommendations (v2)

Declared In:
Headers/SNRContent.h

Related To:
RecommendationOptions
RecommendationResponse

Class:
Content

Declaration:

static func getRecommendations(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)getRecommendations:(SNRRecommendationOptions *)options success:(nullable void (^)(SNRRecommendationResponse *recommendationResponse))success failure:(nullable void (^)(NSError *error))failure

Parameters:

Parameter Type Mandatory Default Description
options RecommendationOptions yes - Options for recommendations
success ((RecommendationResponse) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value:
No value is returned.

Example:

let options: RecommendationOptions = RecommendationOptions()
options.slug = "similar"
options.productID = "1"
Content.getRecommendations(options: options, success: { (recommendationResponse) in
  // success
}) { (error) in
  // failure
}
SNRRecommendationOptions *options = [SNRRecommendationOptions new];
options.slug = @"similar";
options.productID = "1";
[SNRContent getRecommendations:options success:^(SNRRecommendationResponse *recommendationResponse) {
  // success
} failure:^(SNRApiError *error) {
  // failure
}]

Get screen view


This method generates the customer's highest-priority screen view campaign.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 3.7.1 3.7.1 0.9.10 0.2.0
Deprecated in: 4.13.0 5.5.0 0.17.0 0.6.0
Removed in: 5.0.0 6.0.0 1.0.0 2.0.0

The API key must have the SCHEMA_SERVICE_SCHEMA_READ permission from the Schema group.

Replaced By:
Generate screen view and Generate document with query parameters

Declared In:
Headers/SNRContent.h

Related To:
ScreenViewResponse

Class:
Content

Declaration:

static func getScreenView(success: ((ScreenViewResponse) -> Void), failure: ((ApiError) -> Void)) -> Void
+ (void)getScreenViewWithSuccess:(nonnull void (^)(SNRScreenViewResponse *screenViewResponse))success failure:(nonnull void (^)(SNRApiError *error))failure

Parameters:

Parameter Type Mandatory Default Description
success ((ScreenViewResponse ) -> Void) yes - Closure/Block to be executed when the operation is completed successfully
failure ((SNRApiError]) -> Void) yes - Closure/Block to be executed when the operation is completed with an error

Return Value:
No value is returned.

Canonical URL: https://hub.synerise.com/developers/mobile-sdk/method-reference/ios/content