XMMEnduserApi Class Reference
Inherits from | NSObject |
---|---|
Declared in | XMMEnduserApi.h XMMEnduserApi.m |
Overview
XMMEnduserApi
is the main part of the XamoomSDK. You can use it to send api request to the xamoom-api.
Use initWithApiKey: to initialize.
Change the requested language by setting the language. The users language is saved in systemLanguage.
Properties
systemLanguage
The preferred language of the user.
@property (strong, nonatomic) NSString *systemLanguage
Declared In
XMMEnduserApi.h
language
Language used in api calls.
@property (strong, nonatomic) NSString *language
Declared In
XMMEnduserApi.h
restClient
XMMRestClient used to call rest api.
@property (strong, nonatomic) XMMRestClient *restClient
Declared In
XMMEnduserApi.h
offlineApi
XMMOfflineApi used when offline is set.
@property (strong, nonatomic) XMMOfflineApi *offlineApi
Declared In
XMMEnduserApi.h
offline
Indicator to use the XMMOfflineApi.
@property (getter=isOffline, nonatomic) BOOL offline
Declared In
XMMEnduserApi.h
Singleton
+ sharedInstance
Get the sharedInstance. Works only when you already have an instance created with sharedInstanceWithKey:apikey or set via saveSharedInstance:instance.
+ (instancetype)sharedInstance
Declared In
XMMEnduserApi.h
+ sharedInstanceWithKey:
Get the sharedInstance, when there is none, creates a new one with apikey.
+ (instancetype)sharedInstanceWithKey:(NSString *)apikey
Parameters
apikey |
Your xamoom api key |
---|
Declared In
XMMEnduserApi.h
+ saveSharedInstance:
Change the saved sharedInstance.
+ (void)saveSharedInstance:(XMMEnduserApi *)instance
Parameters
instance |
Your XMMEnduserApi instance you want to save |
---|
Discussion
Warning: will override old instance.
Declared In
XMMEnduserApi.h
Initializers
– initWithApiKey:
Initializes with a apikey. You find your apikey in your xamoom system in Settings.
- (instancetype)initWithApiKey:(NSString *)apikey
Parameters
apikey |
Your xamoom api key |
---|
Declared In
XMMEnduserApi.h
– initWithRestClient:
Initializes with a custom XMMRestClient.
- (instancetype)initWithRestClient:(XMMRestClient *)restClient
Parameters
restClient |
Custom XMMRestClient |
---|
Declared In
XMMEnduserApi.h
– contentWithID:completion:
API call to get content with specific ID.
- (NSURLSessionDataTask *)contentWithID:(NSString *)contentID completion:(void ( ^ ) ( XMMContent *content , NSError *error ))completion
Parameters
contentID |
ContentID of xamoom content |
---|---|
completion |
Completion block called after finishing network request - param1 content Content from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentWithID:options:completion:
API call to get content with specific ID and options.
- (NSURLSessionDataTask *)contentWithID:(NSString *)contentID options:(XMMContentOptions)options completion:(void ( ^ ) ( XMMContent *content , NSError *error ))completion
Parameters
contentID |
ContentID of xamoom content |
---|---|
options |
XMMContentOptions for call |
completion |
Completion block called after finishing network request - param1 content Content from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentWithLocationIdentifier:completion:
API call to get content with specific location-identifier.
- (NSURLSessionDataTask *)contentWithLocationIdentifier:(NSString *)locationIdentifier completion:(void ( ^ ) ( XMMContent *content , NSError *error ))completion
Parameters
locationIdentifier |
Locationidentifier from xamoom marker |
---|---|
completion |
Completion block called after finishing network request - param1 content Content from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentWithLocationIdentifier:options:completion:
API call to get content with specific location-identifier with options.
- (NSURLSessionDataTask *)contentWithLocationIdentifier:(NSString *)locationIdentifier options:(XMMContentOptions)options completion:(void ( ^ ) ( XMMContent *content , NSError *error ))completion
Parameters
locationIdentifier |
Locationidentifier from xamoom marker |
---|---|
options |
XMMContentOptions for call |
completion |
Completion block called after finishing network request - param1 content Content from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentWithLocationIdentifier:options:conditions:completion:
API call to get content with specific location-identifier with options and conditions.
- (NSURLSessionDataTask *)contentWithLocationIdentifier:(NSString *)locationIdentifier options:(XMMContentOptions)options conditions:(NSDictionary *)conditions completion:(void ( ^ ) ( XMMContent *content , NSError *error ))completion
Parameters
locationIdentifier |
Locationidentifier from xamoom marker |
---|---|
options |
XMMContentOptions for call |
conditions |
NSDictionary with conditions to match. Allowed value types: numbers, strings and dates. |
completion |
Completion block called after finishing network request - param1 content Content from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentWithBeaconMajor:minor:completion:
API call to get content with beacon.
- (NSURLSessionDataTask *)contentWithBeaconMajor:(NSNumber *)major minor:(NSNumber *)minor completion:(void ( ^ ) ( XMMContent *content , NSError *error ))completion
Parameters
major |
Major of the beacon |
---|---|
minor |
Minor of the beacon |
completion |
Completion block called after finishing network request - param1 content Content from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentWithBeaconMajor:minor:options:completion:
API call to get content with beacon.
- (NSURLSessionDataTask *)contentWithBeaconMajor:(NSNumber *)major minor:(NSNumber *)minor options:(XMMContentOptions)options completion:(void ( ^ ) ( XMMContent *content , NSError *error ))completion
Parameters
major |
Major of the beacon |
---|---|
minor |
Minor of the beacon |
options |
XMMContentOptions for call |
completion |
Completion block called after finishing network request - param1 content Content from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentWithBeaconMajor:minor:options:conditions:completion:
API call to get content with beacon and condition.
- (NSURLSessionDataTask *)contentWithBeaconMajor:(NSNumber *)major minor:(NSNumber *)minor options:(XMMContentOptions)options conditions:(NSDictionary *)conditions completion:(void ( ^ ) ( XMMContent *content , NSError *error ))completion
Parameters
major |
Major of the beacon |
---|---|
minor |
Minor of the beacon |
options |
XMMContentOptions for call |
conditions |
NSDictionary with conditions to match. Allowed value types: numbers, strings and dates. |
completion |
Completion block called after finishing network request - param1 content Content from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Discussion
@warning: Does not work offline. Will return default content from spot.
Declared In
XMMEnduserApi.h
– contentsWithLocation:pageSize:cursor:sort:completion:
API call to get contents around location (40m).
- (NSURLSessionDataTask *)contentsWithLocation:(CLLocation *)location pageSize:(int)pageSize cursor:(NSString *)cursor sort:(XMMContentSortOptions)sortOptions completion:(void ( ^ ) ( NSArray *contents , bool hasMore , NSString *cursor , NSError *error ))completion
Parameters
location |
Location of the user |
---|---|
pageSize |
PageSize you want to get from xamoom cloud |
cursor |
Needed when paging, can be null |
sortOptions |
XMMContentSortOptions to sort result |
completion |
Completion block called after finishing network request - param1 contents Contents from xamoom system - param2 hasMore True if more items on xamoom cloud - param3 cursor Cursor for paging - param4 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentsWithTags:pageSize:cursor:sort:completion:
API call to get contents with specific tags.
- (NSURLSessionDataTask *)contentsWithTags:(NSArray *)tags pageSize:(int)pageSize cursor:(NSString *)cursor sort:(XMMContentSortOptions)sortOptions completion:(void ( ^ ) ( NSArray *contents , bool hasMore , NSString *cursor , NSError *error ))completion
Parameters
tags |
Array of tags |
---|---|
pageSize |
PageSize you want to get from xamoom cloud |
cursor |
Needed when paging, can be null |
sortOptions |
XMMContentSortOptions to sort result |
completion |
Completion block called after finishing network request - param1 contents Contents from xamoom system - param2 hasMore True if more items on xamoom cloud - param3 cursor Cursor for paging - param4 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentsWithName:pageSize:cursor:sort:completion:
API call to fulltext-search contents for name and tags.
- (NSURLSessionDataTask *)contentsWithName:(NSString *)name pageSize:(int)pageSize cursor:(NSString *)cursor sort:(XMMContentSortOptions)sortOptions completion:(void ( ^ ) ( NSArray *contents , bool hasMore , NSString *cursor , NSError *error ))completion
Parameters
name |
Name to search for |
---|---|
pageSize |
PageSize you want to get from xamoom cloud |
cursor |
Needed when paging, can be null |
sortOptions |
XMMContentSortOptions to sort result |
completion |
Completion block called after finishing network request - param1 contents Contents from xamoom system - param2 hasMore True if more items on xamoom cloud - param3 cursor Cursor for paging - param4 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– contentsFrom:to:relatedSpot:pageSize:cursor:sort:completion:
API call to filter contents with a special date or between to dates.
- (NSURLSessionDataTask *)contentsFrom:(NSDate *_Nullable)fromDate to:(NSDate *_Nullable)toDate relatedSpot:(NSString *)relatedSpotID pageSize:(int)pageSize cursor:(NSString *_Nullable)cursor sort:(XMMContentSortOptions)sortOptions completion:(void ( ^ _Nullable ) ( NSArray *_Nullable contents , bool hasMore , NSString *_Nullable cursor , NSError *_Nullable error ))completion
Parameters
fromDate |
Start date of an event |
---|---|
toDate |
End date of an event |
pageSize |
PageSize you want to get from xamoom cloud |
cursor |
Needed when paging, can be null |
sortOptions |
XMMContentSortOptions to sort result |
completion |
Completion block called after finishing network request - param1 contents Contents from xamoom system - param2 hasMore True if more items on xamoom cloud - param3 cursor Cursor for paging - param4 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Discussion
fromDate or toDate must be set, if you want to query for a date.
Declared In
XMMEnduserApi.h
– spotWithID:completion:
API call to get a spot with specific id.
- (NSURLSessionDataTask *)spotWithID:(NSString *)spotID completion:(void ( ^ _Nullable ) ( XMMSpot *_Nullable spot , NSError *_Nullable error ))completion
Parameters
spotID |
SpotId from your xamoom system |
---|---|
completion |
Completion block called after finishing network request - param1 spot The returned spot - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– spotWithID:options:completion:
API call to get a spot with specific id.
- (NSURLSessionDataTask *)spotWithID:(NSString *)spotID options:(XMMSpotOptions)options completion:(void ( ^ ) ( XMMSpot *spot , NSError *error ))completion
Parameters
spotID |
SpotId from your xamoom system |
---|---|
options |
XMMSpotOptions for call |
completion |
Completion block called after finishing network request - param1 spot The returned spot - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– spotsWithLocation:radius:options:sort:completion:
API call to get spots inside radius of a location.
- (NSURLSessionDataTask *)spotsWithLocation:(CLLocation *)location radius:(int)radius options:(XMMSpotOptions)options sort:(XMMSpotSortOptions)sortOptions completion:(void ( ^ ) ( NSArray *spots , bool hasMore , NSString *cursor , NSError *error ))completion
Parameters
location |
Location of the user |
---|---|
radius |
Radius in meter |
options |
XMMSpotOptions to get markers or content |
sortOptions |
XMMSpotSortOptions to sort the results |
completion |
Completion block called after finishing network request - param1 spots Spots from xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– spotsWithLocation:radius:options:sort:pageSize:cursor:completion:
API call to get spots inside radius of a location.
- (NSURLSessionDataTask *)spotsWithLocation:(CLLocation *)location radius:(int)radius options:(XMMSpotOptions)options sort:(XMMSpotSortOptions)sortOptions pageSize:(int)pageSize cursor:(NSString *)cursor completion:(void ( ^ ) ( NSArray *spots , bool hasMore , NSString *cursor , NSError *error ))completion
Parameters
location |
Location of the user |
---|---|
radius |
Radius in meter |
options |
XMMSpotOptions to get markers or content |
sortOptions |
XMMSpotSortOptions to sort the results |
pageSize |
PageSize you want to get from xamoom cloud |
cursor |
Needed when paging, can be null - param1 spots Spots from xamoom system - param2 hasMore True if more items on xamoom cloud - param3 cursor Cursor for paging - param4 error NSError, can be null |
completion |
Completion block called after finishing network request |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– spotsWithTags:options:sort:completion:
API call to get spots with specific tags. Returns max. 100 spots.
- (NSURLSessionDataTask *)spotsWithTags:(NSArray *)tags options:(XMMSpotOptions)options sort:(XMMSpotSortOptions)sortOptions completion:(void ( ^ ) ( NSArray *spots , bool hasMore , NSString *cursor , NSError *error ))completion
Parameters
tags |
Array of tags |
---|---|
options |
XMMSpotOptions to get markers or content |
sortOptions |
XMMSpotSortOptions to sort the results |
completion |
Completion block called after finishing network request - param1 spots Spots from xamoom system - param2 hasMore True if more items on xamoom cloud - param3 cursor Cursor for paging - param4 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– spotsWithTags:pageSize:cursor:options:sort:completion:
API call to get spots with specific tags.
- (NSURLSessionDataTask *)spotsWithTags:(NSArray *)tags pageSize:(int)pageSize cursor:(NSString *)cursor options:(XMMSpotOptions)options sort:(XMMSpotSortOptions)sortOptions completion:(void ( ^ ) ( NSArray *spots , bool hasMore , NSString *cursor , NSError *error ))completion
Parameters
tags |
Array of tags |
---|---|
pageSize |
PageSize you want to get from xamoom cloud |
cursor |
Needed when paging, can be null |
options |
XMMSpotOptions to get markers or content |
sortOptions |
XMMSpotSortOptions to sort results |
completion |
Completion block called after finishing network request - param1 spots Spots from xamoom system - param2 hasMore True if more items on xamoom cloud - param3 cursor Cursor for paging - param4 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– spotsWithName:pageSize:cursor:options:sort:completion:
API call to fulltext-search spots by name.
- (NSURLSessionDataTask *)spotsWithName:(NSString *)name pageSize:(int)pageSize cursor:(NSString *)cursor options:(XMMSpotOptions)options sort:(XMMSpotSortOptions)sortOptions completion:(void ( ^ ) ( NSArray *spots , bool hasMore , NSString *cursor , NSError *error ))completion
Parameters
name |
Name to search for |
---|---|
pageSize |
PageSize you want to get from xamoom cloud |
cursor |
Needed when paging, can be null |
options |
XMMSpotOptions to get markers or content |
sortOptions |
XMMSpotSortOptions to sort results |
completion |
Completion block called after finishing network request - param1 spots Spots from xamoom system - param2 hasMore True if more items on xamoom cloud - param3 cursor Cursor for paging - param4 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– systemWithCompletion:
API call that returns your system.
- (NSURLSessionDataTask *)systemWithCompletion:(void ( ^ ) ( XMMSystem *system , NSError *error ))completion
Parameters
completion |
Completion block called after finishing network request - param1 system System from xamoom system - param2 error NSError, can be null |
---|
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– systemSettingsWithID:completion:
API call that returns your system settings.
- (NSURLSessionDataTask *)systemSettingsWithID:(NSString *)settingsID completion:(void ( ^ ) ( XMMSystemSettings *settings , NSError *error ))completion
Parameters
settingsID |
ID you get from systemWithCompletion: |
---|---|
completion |
Completion block called after finishing network request - param1 settings System settings from your xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– styleWithID:completion:
API call that returns your system style.
- (NSURLSessionDataTask *)styleWithID:(NSString *)styleID completion:(void ( ^ ) ( XMMStyle *style , NSError *error ))completion
Parameters
styleID |
ID you get from systemWithCompletion: |
---|---|
completion |
Completion block called after finishing network request - param1 style System style from your xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– menuWithID:completion:
API call that returns your menu.
- (NSURLSessionDataTask *)menuWithID:(NSString *)menuID completion:(void ( ^ ) ( XMMMenu *menu , NSError *error ))completion
Parameters
menuID |
ID you get from systemWithCompletion: |
---|---|
completion |
Completion block called after finishing network request - param1 style System style from your xamoom system - param2 error NSError, can be null |
Return Value
SessionDataTask used to download from the backend.
Declared In
XMMEnduserApi.h
– customUserAgentFrom:
- (NSString *)customUserAgentFrom:(NSString *)appName
Declared In
XMMEnduserApi.h