OlapicSDK Class Reference
| Inherits from | NSObject |
| Declared in | OlapicSDK.h |
Tasks
Initializer
Connection
-
– connectWithOAuthMethod:onSuccess:onFailure: -
– connectWithOAuthMethod:onSuccess:onFailure:toEndpoint:withParameters: -
– logout
URLs
REST and OAuth
Customer
Handlers
Utils
-
– prepareURLWithType:context: -
– prepareCurationURLWithType:context: -
– prepareCurationURLWithType:context:withDomain: -
– connected -
– getDisconnectedError -
– getApp
Social
-
– hasTwitterApp -
– hasInstagramApp -
– hasFacebookApp -
– getInstagramShareViewForMedia:withImage: -
– getInstagramShareViewForMedia:withImage:andCaption:
Log
Instance Methods
categories
Get access to the category handler object
- (OlapicCategoryHandler *)categoriesReturn Value
The category handler
Availability
v1.0
Declared In
OlapicSDK.hconnectWithOAuthMethod: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 ))failureParameters
- 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.hconnectWithOAuthMethod: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 *)parametersParameters
- 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.hconnected
Check if the initial connection was made
- (BOOL)connectedReturn Value
That
Availability
v1.0
Declared In
OlapicSDK.hcustomer
Get access to the current customer entity
- (OlapicCustomerEntity *)customerReturn Value
The object for the customer
Availability
v1.0
Declared In
OlapicSDK.hcustomers
Get access to the customer handler object
- (OlapicCustomerHandler *)customersReturn Value
The customer handler
Availability
v1.0
Declared In
OlapicSDK.hgetApp
Get a reference to the shared instance of the application
- (UIApplication *)getAppReturn Value
The app instance
Availability
v1.0
Declared In
OlapicSDK.hgetBaseURL
Get the current endpoint for the API
- (NSString *)getBaseURLReturn Value
The URL
Availability
v1.0
Declared In
OlapicSDK.hgetBulkURL
Get the current endpoint for bulk requests
- (NSString *)getBulkURLReturn Value
The URL
Availability
v1.0
Declared In
OlapicSDK.hgetCurationURL
Get the current endpoint for the curation methods of the API
- (NSString *)getCurationURLReturn Value
The URL
Availability
v1.0
Declared In
OlapicSDK.hgetDisconnectedError
Get a standard NSError to inform that the initial connection couldn’t be made
- (NSDictionary *)getDisconnectedErrorReturn Value
The error with the reason why the connection failed
Availability
v1.0
Declared In
OlapicSDK.hgetInstagramShareViewForMedia:withImage:
Get the popup view for sharing a media on Instagram
- (UIDocumentInteractionController *)getInstagramShareViewForMedia:(OlapicMediaEntity *)media withImage:(UIImageView *)imageReturn Value
The sharing view
Availability
v1.0
Declared In
OlapicSDK.hgetInstagramShareViewForMedia: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 *)captionReturn Value
The sharing view
Availability
v1.0
Declared In
OlapicSDK.hgetOAuth
Get the current OAuth connection method
- (OlapicOAuthMethod *)getOAuthReturn Value
A subclass of OlapicOAuthMethod
Declared In
OlapicSDK.hhasFacebookApp
Check if the Facebook app is installed
- (BOOL)hasFacebookAppReturn Value
If the app is installed
Availability
v1.0
Declared In
OlapicSDK.hhasInstagramApp
Check if the Instagram app is installed
- (BOOL)hasInstagramAppReturn Value
If the app is installed
Availability
v1.0
Declared In
OlapicSDK.hhasTwitterApp
Check if the Twitter app is installed
- (BOOL)hasTwitterAppReturn Value
If the app is installed
Availability
v1.0
Declared In
OlapicSDK.hlogURL:done:
Log a URL request on the console
- (void)logURL:(NSString *)url done:(BOOL)doneParameters
- 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.hlogout
Reset the SDK in order to connect with another customer credentials
- (void)logoutAvailability
v1.0
Declared In
OlapicSDK.hmedia
Get access to the media handler object
- (OlapicMediaHandler *)mediaReturn Value
The media handler
Availability
v1.0
Declared In
OlapicSDK.hprepareCurationURLWithType:context:
Prepare a specific URL for curation
- (NSString *)prepareCurationURLWithType:(NSString *)type context:(NSDictionary *)contextParameters
- 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.hprepareCurationURLWithType: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)domainParameters
- 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.hprepareURLWithType:context:
Prepare a URL for a specific endpoint
- (NSString *)prepareURLWithType:(NSString *)type context:(NSDictionary *)contextParameters
- 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.hrest
Get access to the rest client
- (OlapicRestClient *)restReturn Value
The object for the rest client
Availability
v1.0
Declared In
OlapicSDK.hsetOAuthConnectionMethod:
Set the OAuth connection method for the SDK
- (void)setOAuthConnectionMethod:(OlapicOAuthMethod *)methodParameters
- method
A subclass of OlapicOAuthMethod
Availability
v1.0
Declared In
OlapicSDK.hstartLoggingURLs
Turn on a flag that starts showing all the URLs being called by the SDK on the console
- (void)startLoggingURLsAvailability
v1.0
Declared In
OlapicSDK.hstatuses
Get access to the curation statuses handler
- (OlapicMediaStatusHandler *)statusesReturn Value
The statuses handler
Availability
v1.0
Declared In
OlapicSDK.hstreams
Get access to the stream handler object
- (OlapicStreamHandler *)streamsReturn Value
The stream handler
Availability
v1.0
Declared In
OlapicSDK.h