Inherits from OlapicHandler : NSObject
Declared in OlapicCustomerHandler.h

Overview

The object in charge of the customers common functionalities

Instance Methods

createUploaderFromCustomer:metadata:onSuccess:onFailure:

Create an uploader for a customer

- (void)createUploaderFromCustomer:(OlapicCustomerEntity *)customer metadata:(NSDictionary *)metadata onSuccess:(void ( ^ ) ( OlapicUploaderEntity *uploader ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

customer

The customer object

metadata

A dictionary that contains the uploader information

success

A callback block for when the uploader is successfully created

failure

A callback block for when the SDK can’t create the uploader

Availability

v1.0

Discussion

Example:

NSMutableDictionary *metadata = [[NSMutableDictionary alloc] init];
[metadata setValue:@"example@olapic.com" forKey:@"email"];
[metadata setValue:@"Example" forKey:@"screen_name"];
OlapicSDK *olapic = [OlapicSDK sharedOlapicSDK]
[[olapic customers] createUploaderFromCustomer:[olapic customer]
                    metadata:metadata
                    onSuccess:^(OlapicUploaderEntity *uploader){
                        // Now you can upload some media
                    }
                    onFailure:^(NSError *error){
                        NSLog(@"Error: %@",error.description);
                    }];

Declared In

OlapicCustomerHandler.h

getUploaderFromCustomer:onSuccess:onFailure:

Get the default uploader for a specific customer

- (void)getUploaderFromCustomer:(OlapicCustomerEntity *)customer onSuccess:(void ( ^ ) ( OlapicUploaderEntity *uploader ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

customer

The customer object

success

A callback block for when the uploader is successfully retrieved

failure

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

Availability

v1.0

Discussion

Example:

OlapicSDK *olapic = [OlapicSDK sharedOlapicSDK]
[[olapic customers] getUploaderFromCustomer:[olapic customer]
                    onSuccess:^(OlapicUploaderEntity *uploader){
                        // Now you can upload some media
                    }
                    onFailure:^(NSError *error){
                        NSLog(@"Error: %@",error.description);
                    }];

Declared In

OlapicCustomerHandler.h