XMMEnduserApi Class Reference

Inherits from NSObject
Conforms to NSXMLParserDelegate
Declared in XMMEnduserApi.h
XMMEnduserApi.m

Overview

XMMEnduserApi is the main part of the xamoom-ios-sdk. You can use it to send api request to the xamoom-api.

For everything just use the shared instance: [XMMEnduserApi sharedInstance].

Before you can start you have to set a API key: [[XMMEnduserApi sharedInstance] setApiKey:apiKey];

Properties

  systemLanguage

The preferred language of the user.

@property (strong, nonatomic) NSString *systemLanguage

Declared In

XMMEnduserApi.h

  qrCodeViewControllerCancelButtonTitle

String with the title of the qr code view cancel button.

@property (strong, nonatomic) NSString *qrCodeViewControllerCancelButtonTitle

Declared In

XMMEnduserApi.h

+ sharedInstance

A shared instance from XMMEnduserApi.

+ (XMMEnduserApi *)sharedInstance

Declared In

XMMEnduserApi.h

  objectManager

RKObjectManager used to make calls to api.

@property (strong, nonatomic) RKObjectManager *objectManager

Declared In

XMMEnduserApi.h

Inits

– init

Inits the XMMEnduserApi: sets the apiBaseUrl and gets the preferred systemLanguage.

- (instancetype)init

Return Value

id

Declared In

XMMEnduserApi.h

– setApiKey:

Set your API Key from the xamoom-system.

- (void)setApiKey:(NSString *)apiKey

Parameters

apiKey

The API key from your xamoom system

Declared In

XMMEnduserApi.h

API Calls

– contentWithContentId:includeStyle:includeMenu:withLanguage:full:preview:completion:error:

Makes an api call to xamoom with a unique contentId. If the selected language is not available the default language will be returned.

- (void)contentWithContentId:(NSString *)contentId includeStyle:(BOOL)style includeMenu:(BOOL)menu withLanguage:(NSString *)language full:(BOOL)full preview:(BOOL)preview completion:(void ( ^ ) ( XMMContentById *result ))completionHandler error:(void ( ^ ) ( XMMError *error ))errorHandler

Parameters

contentId

The id of the content from xamoom backend

style

True or False for returning the style from xamoom backend as XMMStyle

menu

True or False for returning the menu from xamoom backend as Array of XMMMenuItem

language

The requested language of the content from xamoom backend

full

True or false for returning “unsynced” data or not

preview

If YES it won’t show up in statistics.

completionHandler

CompletionHandler returns the result

errorHandler

ErrorHandler returns an error if one occures

  • param1 error A XMMError with error informations

Return Value

void

Declared In

XMMEnduserApi.h

– contentWithLocationIdentifier:majorId:includeStyle:includeMenu:withLanguage:completion:error:

Makes an api call to xamoom with a unique locationIdentifier (code saved on NFC or QR). If the selected language is not available the default language will be returned.

- (void)contentWithLocationIdentifier:(NSString *)locationIdentifier majorId:(NSString *)majorId includeStyle:(BOOL)style includeMenu:(BOOL)menu withLanguage:(NSString *)language completion:(void ( ^ ) ( XMMContentByLocationIdentifier *result ))completionHandler error:(void ( ^ ) ( XMMError *error ))errorHandler

Parameters

locationIdentifier

The locationidentifier (code saved on NFC or QR) of the marker from xamoom backend

majorId

BeaconMajor, only when you use a beacon.

style

True or False for returning the style from xamoom backend as XMMStyle

menu

True of False for returning the menu from xamoom backend as Array of XMMMenuItem

language

The requested language of the content from xamoom backend

completionHandler

CompletionHandler returns the result

errorHandler

ErrorHandler returns an error if one occures

  • param1 error A XMMError with error informations

Return Value

void

Declared In

XMMEnduserApi.h

– contentWithLat:withLon:withLanguage:completion:error:

Makes an api call to xamoom with a location (lat & lon). If the selected language is not available the default language will be returned.

- (void)contentWithLat:(NSString *)lat withLon:(NSString *)lon withLanguage:(NSString *)language completion:(void ( ^ ) ( XMMContentByLocation *result ))completionHandler error:(void ( ^ ) ( XMMError *error ))errorHandler

Parameters

lat

The latitude of a location

lon

The longitude of a location

language

The requested language of the content from xamoom backend

completionHandler

CompletionHandler returns the result

errorHandler

ErrorHandler returns an error if one occures

  • param1 error A XMMError with error informations

Return Value

void

Declared In

XMMEnduserApi.h

– spotMapWithMapTags:withLanguage:includeContent:completion:error:

Makes an api call to xamoom with params to get a list of all items, so you can show them on a map

- (void)spotMapWithMapTags:(NSArray *)mapTags withLanguage:(NSString *)language includeContent:(BOOL)includeContent completion:(void ( ^ ) ( XMMSpotMap *result ))completionHandler error:(void ( ^ ) ( XMMError *error ))errorHandler

Parameters

mapTags

The tags of the wanted spots

language

The requested language of the content from xamoom backend

includeContent

Will return contentId of spots with assigned content if YES

completionHandler

CompletionHandler returns the result

  • param1 result The result from xamoom backend as XMMSpotMap
errorHandler

ErrorHandler returns an error if one occures

  • param1 error A XMMError with error informations

Return Value

void

Declared In

XMMEnduserApi.h

– contentListWithPageSize:withLanguage:withCursor:withTags:completion:error:

Makes an api call to xamoom with a unique contentId. If the selected language is not available the default language will be returned.

- (void)contentListWithPageSize:(int)pageSize withLanguage:(NSString *)language withCursor:(NSString *)cursor withTags:(NSArray *)tags completion:(void ( ^ ) ( XMMContentList *result ))completionHandler error:(void ( ^ ) ( XMMError *error ))errorHandler

Parameters

pageSize

Number of items you will get returned

language

The requested language of the content from xamoom backend

cursor

Cursor for paging

tags

Tags as an array

completionHandler

CompletionHandler returns the result

errorHandler

ErrorHandler returns an error if one occures

  • param1 error A XMMError with error informations

Return Value

void

Declared In

XMMEnduserApi.h

– closestSpotsWithLat:withLon:withRadius:withLimit:withLanguage:completion:error:

Makes an api call to xamoom with a location and returns the closest spots. If the selected language is not available the default language will be returned.

- (void)closestSpotsWithLat:(float)lat withLon:(float)lon withRadius:(int)radius withLimit:(int)limit withLanguage:(NSString *)language completion:(void ( ^ ) ( XMMClosestSpot *result ))completionHandler error:(void ( ^ ) ( XMMError *error ))errorHandler

Parameters

lat

Latitude

lon

Longitude

radius

Radius in decimenter

limit

Limit of the results

language

The requested language of the content from xamoom backend

completionHandler

CompletionHandler returns the result

errorHandler

ErrorHandler returns an error if one occures

  • param1 error A XMMError with error informations

Return Value

void

Declared In

XMMEnduserApi.h

– geofenceAnalyticsMessageWithRequestedLanguage:withDeliveredLanguage:withSystemId:withSystemName:withContentId:withContentName:withSpotId:withSpotName:

Makes an api call to xamoom when a user clicks a geofenced content for analytics.

- (void)geofenceAnalyticsMessageWithRequestedLanguage:(NSString *)requestedLanguage withDeliveredLanguage:(NSString *)deliveredLanguage withSystemId:(NSString *)systemId withSystemName:(NSString *)systemName withContentId:(NSString *)contentId withContentName:(NSString *)contentName withSpotId:(NSString *)spotId withSpotName:(NSString *)spotName

Parameters

requestedLanguage

The language you requested from the xamoom system

deliveredLanguage

The language you got from the xamoom system

systemId

The systemId you got from the xamoom system

systemName

The systemName you got from the xamoom system

contentId

The contentId you got from the xamoom system

contentName

The contentName you got from the xamoom system

spotId

The spotId you got from the system

spotName

The spotName you got from the system

Declared In

XMMEnduserApi.h

– apiPostWithPath:andDescriptor:andParams:completion:error:

Post to xamoom enduser-api.

- (void)apiPostWithPath:(NSString *)path andDescriptor:(RKResponseDescriptor *)descriptor andParams:(NSDictionary *)params completion:(void ( ^ ) ( id result ))completionHandler error:(void ( ^ ) ( XMMError *error ))errorHandler

Parameters

path

Enduser-api path

descriptor

RKResponseDescriptor

params

Parameters as NSDictionary

completionHandler

A completionHandler block

errorHandler

A errorhandler block

Declared In

XMMEnduserApi.h

– apiGetWithPath:andDescriptor:andParams:completion:error:

Get to xamoom enduser-api.

- (void)apiGetWithPath:(NSString *)path andDescriptor:(RKResponseDescriptor *)descriptor andParams:(NSDictionary *)params completion:(void ( ^ ) ( id result ))completionHandler error:(void ( ^ ) ( XMMError *error ))errorHandler

Parameters

path

Enduser-api path

descriptor

RKResponseDescriptor

params

Paramters as NSDicationary

completionHandler

A completionHandler block

errorHandler

A errorhandler block

Declared In

XMMEnduserApi.h

QRCodeReaderViewController

– startQRCodeReaderFromViewController:didLoad:

Starts the QRCodeReaderViewController to scan qr codes.

- (void)startQRCodeReaderFromViewController:(UIViewController *)viewController didLoad:(void ( ^ ) ( NSString *locationIdentifier , NSString *url ))completionHandler

Parameters

viewController

The ViewController from where you want to call the QRCodeReader (usually self)

completionHandler

CompletionHandler returns the result - param1 locationIdentifier NSString with only the locaitionIdentifier of the scanned QR - param2 url NSString wiht the complete scanned url

Return Value

void

Declared In

XMMEnduserApi.h

– checkUrlPrefix:

Will return an url with http:// if there is none. Returns url without changes if there is a http:// or https:// as prefix.

- (NSString *)checkUrlPrefix:(NSString *)URL

Parameters

URL

Url like “http://xm.gl/0ana0

Return Value

Returns an url with http:// in front.

Declared In

XMMEnduserApi.h

– locationIdentifierFromURL:

Returns the LocationIdentifier, when you enter an url with locationIdentifier like “http://xm.gl/0ana0”.

- (NSString *)locationIdentifierFromURL:(NSString *)URL

Parameters

URL

A http://xm.gl/* url.

Return Value

A locationIdentifier

Declared In

XMMEnduserApi.h