Inherits from NSObject
Declared in OlapicSDK.h

Overview

The main singleton object for the SDK

Class Methods

sharedOlapicSDK

Get the singleton shared instance

+ (instancetype)sharedOlapicSDK

Return Value

The shared instance

Availability

v1.0

Declared In

OlapicSDK.h

Instance Methods

categories

Get access to the category handler object

- (OlapicCategoryHandler *)categories

Return Value

The category handler

Availability

v1.0

Declared In

OlapicSDK.h

connectWithOAuthMethod:onSuccess:onFailure:

Create the initial connection between the application and the API

- (void)connectWithOAuthMethod:(OlapicOAuthMethod *)method onSuccess:(void ( ^ ) ( OlapicCustomerEntity *customer ))success onFailure:(void ( ^ ) ( NSError *error ))failure

Parameters

method

The selected OAuth connection method

success

A callback block for when the application successfully connects

failure

A callback block for when the connection fails

Declared In

OlapicSDK.h

connectWithOAuthMethod:onSuccess:onFailure:toEndpoint:withParameters:

Create the initial connection between the application and the API

- (void)connectWithOAuthMethod:(OlapicOAuthMethod *)method onSuccess:(void ( ^ ) ( NSDictionary *response ))success onFailure:(void ( ^ ) ( NSError *error ))failure toEndpoint:(OlapicEndpointType)endpoint withParameters:(NSDictionary *)parameters

Parameters

method

The selected OAuth connection method

success

A callback block for when the application successfully connects

failure

A callback block for when the connection fails

endpoint

Each one of this endpoint will have different responses.

  • OlapicEndpointTypeDefault
  • OlapicEndpointTypeCustomerMedia
  • OlapicEndpointTypeCategoryMedia
  • OlapicEndpointTypeStreamMedia
  • OlapicEndpointTypeStream
  • OlapicEndpointTypeCategory
  • OlapicEndpointTypeStreamSearch
  • OlapicEndpointTypeCategorySearch
  • OlapicEndpointTypeWidgetInstance
parameters

The available parameteres are:

  • sort: The sorting for the media list
  • count: The limit of results per request
  • tag_key: The string to search streams or categories
  • customer: The customer ID
  • stream: The stream ID
  • category: The category ID
  • delegate: The pointer
  • widget_instance: The widget instance hash

Availability

v1.0

Declared In

OlapicSDK.h

connected

Check if the initial connection was made

- (BOOL)connected

Return Value

That

Availability

v1.0

Declared In

OlapicSDK.h

customer

Get access to the current customer entity

- (OlapicCustomerEntity *)customer

Return Value

The object for the customer

Availability

v1.0

Declared In

OlapicSDK.h

customers

Get access to the customer handler object

- (OlapicCustomerHandler *)customers

Return Value

The customer handler

Availability

v1.0

Declared In

OlapicSDK.h

getApp

Get a reference to the shared instance of the application

- (UIApplication *)getApp

Return Value

The app instance

Availability

v1.0

Declared In

OlapicSDK.h

getBaseURL

Get the current endpoint for the API

- (NSString *)getBaseURL

Return Value

The URL

Availability

v1.0

Declared In

OlapicSDK.h

getBulkURL

Get the current endpoint for bulk requests

- (NSString *)getBulkURL

Return Value

The URL

Availability

v1.0

Declared In

OlapicSDK.h

getCurationURL

Get the current endpoint for the curation methods of the API

- (NSString *)getCurationURL

Return Value

The URL

Availability

v1.0

Declared In

OlapicSDK.h

getDisconnectedError

Get a standard NSError to inform that the initial connection couldn’t be made

- (NSDictionary *)getDisconnectedError

Return Value

The error with the reason why the connection failed

Availability

v1.0

Declared In

OlapicSDK.h

getInstagramShareViewForMedia:withImage:

Get the popup view for sharing a media on Instagram

- (UIDocumentInteractionController *)getInstagramShareViewForMedia:(OlapicMediaEntity *)media withImage:(UIImageView *)image

Parameters

media

The media to share

image

The media image

Return Value

The sharing view

Availability

v1.0

Declared In

OlapicSDK.h

getInstagramShareViewForMedia:withImage:andCaption:

Get the popup view for sharing a media on Instagram with a default caption

- (UIDocumentInteractionController *)getInstagramShareViewForMedia:(OlapicMediaEntity *)media withImage:(UIImageView *)image andCaption:(NSString *)caption

Parameters

media

The media to share

image

The media image

caption

The default caption

Return Value

The sharing view

Availability

v1.0

Declared In

OlapicSDK.h

getOAuth

Get the current OAuth connection method

- (OlapicOAuthMethod *)getOAuth

Return Value

A subclass of OlapicOAuthMethod

Declared In

OlapicSDK.h

hasFacebookApp

Check if the Facebook app is installed

- (BOOL)hasFacebookApp

Return Value

If the app is installed

Availability

v1.0

Declared In

OlapicSDK.h

hasInstagramApp

Check if the Instagram app is installed

- (BOOL)hasInstagramApp

Return Value

If the app is installed

Availability

v1.0

Declared In

OlapicSDK.h

hasTwitterApp

Check if the Twitter app is installed

- (BOOL)hasTwitterApp

Return Value

If the app is installed

Availability

v1.0

Declared In

OlapicSDK.h

logURL:done:

Log a URL request on the console

- (void)logURL:(NSString *)url done:(BOOL)done

Parameters

url

The URL to log

done

If its NO, the request just started, if its YES, the request just finished

Availability

v1.0

Declared In

OlapicSDK.h

logout

Reset the SDK in order to connect with another customer credentials

- (void)logout

Availability

v1.0

Declared In

OlapicSDK.h

media

Get access to the media handler object

- (OlapicMediaHandler *)media

Return Value

The media handler

Availability

v1.0

Declared In

OlapicSDK.h

prepareCurationURLWithType:context:

Prepare a specific URL for curation

- (NSString *)prepareCurationURLWithType:(NSString *)type context:(NSDictionary *)context

Parameters

type

The URL type

context

The information to be used to build the URL

Return Value

A URL ready to be used with the API

Availability

v1.0

Declared In

OlapicSDK.h

prepareCurationURLWithType:context:withDomain:

Prepare a specific URL for curation and set if it should return the base domain or just the relative path

- (NSString *)prepareCurationURLWithType:(NSString *)type context:(NSDictionary *)context withDomain:(BOOL)domain

Parameters

type

The URL type

context

The information to be used to build the URL

domain

If the URL should include the domain or just the relative path

Return Value

A URL ready to be used with the API

Availability

v1.0

Declared In

OlapicSDK.h

prepareURLWithType:context:

Prepare a URL for a specific endpoint

- (NSString *)prepareURLWithType:(NSString *)type context:(NSDictionary *)context

Parameters

type

The URL type

context

The information to be used to build the URL

Return Value

A URL ready to be used with the API

Availability

v1.0

Declared In

OlapicSDK.h

rest

Get access to the rest client

- (OlapicRestClient *)rest

Return Value

The object for the rest client

Availability

v1.0

Declared In

OlapicSDK.h

setOAuthConnectionMethod:

Set the OAuth connection method for the SDK

- (void)setOAuthConnectionMethod:(OlapicOAuthMethod *)method

Parameters

method

A subclass of OlapicOAuthMethod

Availability

v1.0

Declared In

OlapicSDK.h

startLoggingURLs

Turn on a flag that starts showing all the URLs being called by the SDK on the console

- (void)startLoggingURLs

Availability

v1.0

Declared In

OlapicSDK.h

statuses

Get access to the curation statuses handler

- (OlapicMediaStatusHandler *)statuses

Return Value

The statuses handler

Availability

v1.0

Declared In

OlapicSDK.h

streams

Get access to the stream handler object

- (OlapicStreamHandler *)streams

Return Value

The stream handler

Availability

v1.0

Declared In

OlapicSDK.h

uploaders

Get access to the uploader handler object

- (OlapicUploaderHandler *)uploaders

Return Value

The uploader handler

Availability

v1.0

Declared In

OlapicSDK.h

widgetInstances

Get access to the widget instances handler object

- (OlapicWidgetInstanceHandler *)widgetInstances

Return Value

The widget instance handler

Availability

v1.0

Declared In

OlapicSDK.h