Inherits from OlapicHandler : NSObject
Declared in OlapicStreamHandler.h

Overview

The object in charge of the streams common functionalities

Instance Methods

getStreamByID:onSuccess:onFailure:

Get a stream entity by its ID

- (void)getStreamByID:(NSString *)ID onSuccess:(void ( ^ ) ( OlapicStreamEntity *stream ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

ID

The stream ID

success

A callback block for when the stream is successfully retrieved

failure

A callback block for when the SDK can’t get the stream

Availability

v1.0

Discussion

Example:

[[[OlapicSDK sharedOlapicSDK] streams] getStreamByID:@"ID"
                                       onSuccess:^(OlapicStreamEntity *stream){
                                           label.text = [stream get:@"name"];
                                       }
                                       onFailure:^(NSError *error){
                                           NSLog(@"Error: %@",error.description);
                                       }];

Declared In

OlapicStreamHandler.h

getStreamByTagKey:onSuccess:onFailure:

Get a stream entity by its tag_key property

- (void)getStreamByTagKey:(NSString *)tag onSuccess:(void ( ^ ) ( OlapicStreamEntity *stream ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

tag

The value of the tag_key property

success

A callback block for when the stream is successfully retrieved

failure

A callback block for when the SDK can’t get the stream

Availability

v1.0

Discussion

Example:

[[[OlapicSDK sharedOlapicSDK] streams] getStreamByTagKey:@"my_tag"
                                       onSuccess:^(OlapicStreamEntity *stream){
                                           label.text = [stream get:@"name"];
                                       }
                                       onFailure:^(NSError *error){
                                           NSLog(@"Error: %@",error.description);
                                       }];

Declared In

OlapicStreamHandler.h

getStreamFromURL:onSuccess:onFailure:

Get a stream entity from it’s API URL

- (void)getStreamFromURL:(NSString *)URL onSuccess:(void ( ^ ) ( OlapicStreamEntity *stream ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

URL

The API URL for the stream

success

A callback block for when the stream is successfully retrieved

failure

A callback block for when the SDK can’t get the stream

Availability

v1.0

Discussion

Example:

[[[OlapicSDK sharedOlapicSDK] streams] getStreamFromURL:@"streams/001"
                                       onSuccess:^(OlapicStreamEntity *stream){
                                           label.text = [stream get:@"name"];
                                       }
                                       onFailure:^(NSError *error){
                                           NSLog(@"Error: %@",error.description);
                                       }];

Declared In

OlapicStreamHandler.h

getStreamFromURL:onSuccess:onFailure:parameters:

Get the Stream entity from API’s URL with extra parameters

- (void)getStreamFromURL:(NSString *)URL onSuccess:(void ( ^ ) ( OlapicStreamEntity *stream ))success onFailure:(void ( ^ ) ( NSError *error ))failure parameters:(NSDictionary *)parameters

Parameters

URL

The API URL for the stream

success

A callback block for when the stream is successfully retrieved

failure

A callback block for when the SDK can’t get the stream

parameters

A list of parameters for the request, like ‘count’ or ‘limit’

Availability

v1.0

Discussion

Example:

[[[OlapicSDK sharedOlapicSDK] streams] getStreamFromURL:@"streams/001"
                                       onSuccess:^(OlapicStreamEntity *stream){
                                           label.text = [stream get:@"name"];
                                       }
                                       onFailure:^(NSError *error){
                                           NSLog(@"Error: %@",error.description);
                                       } parameters:nil];

Declared In

OlapicStreamHandler.h

searchStreamsForCuration:onSuccess:onFailure:

Get Streams entities for curation

- (void)searchStreamsForCuration:(NSString *)query onSuccess:(void ( ^ ) ( NSDictionary *streams ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

query

Any string that matches the name, the product_url or the product_identifier of the stream

success

A callback block for when the streams are successfully retrieved

failure

A callback block for when the SDK can’t get the streams

Discussion

Example:

[[[OlapicSDK sharedOlapicSDK] streams] searchStreamsForCuration:@"olapic"
onSuccess:^(NSDictionary *streams) {
NSLog(@"%@", streams);
}
onFailure:^(NSError *error) {
NSLog(@"Error: %@",error.description);
}];

Declared In

OlapicStreamHandler.h