B4SSingleton Class Reference

Inherits from NSObject
Declared in B4SSingleton.h

  delegate

The delegate

@property (nonatomic, weak) id<B4SDelegate> delegate

Declared In

B4SSingleton.h

  beaconBackgroundScanEnabled

When set to NO, the SDK will stop using CoreLocation regions to look for beacons when the application is in background. Default value is YES /!\ When the application is in foreground, the SDK keeps looking for beacons

@property (nonatomic) BOOL beaconBackgroundScanEnabled

Declared In

B4SSingleton.h

  notificationSoundname

The name of the filename played when a notification is shonw to the user. This must be the name a a file in CAF format (“Core Audio File”) present in the app bundle

@property (nonatomic, retain) NSString *notificationSoundname

Declared In

B4SSingleton.h

– setUserProperty:withInteger:

Store a integer property about the user. This value will be sent to the server

- (BOOL)setUserProperty:(NSString *)key withInteger:(NSInteger)number

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

number

The value.

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withFloat:

Store a float property about the user. This value will be sent to the server

- (BOOL)setUserProperty:(NSString *)key withFloat:(float)number

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

number

The value.

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withString:

Store a string property about the user. This value will be sent to the server

- (BOOL)setUserProperty:(NSString *)key withString:(NSString *)string

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

number

The value. Pass [NSNull null] to delete a previously existing value

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withGender:

Store a gender property about the user. This value will be sent to the server

- (BOOL)setUserProperty:(NSString *)key withGender:(B4SCustomerGender)gender

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

number

The value. Pass B4SCustomerGender_UNDEFINED to delete a previously existing value

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withArray:

Store a Array property about the user. This value will be sent to the server

- (BOOL)setUserProperty:(NSString *)key withArray:(NSArray *)array

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

number

The value. Pass [NSNull null] to delete a previously existing value. The array cannot contain another array, nor contains types other that NSString, NSNumber, NSDate. All objects inside the array must have the same data type

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withDate:

Store a date property about the user. This value will be sent to the server

- (BOOL)setUserProperty:(NSString *)key withDate:(NSDate *)date

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

number

The value. Pass [NSNull null] to delete a previously existing value

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withInteger:andLocalOnly:

Store a integer property about the user

- (BOOL)setUserProperty:(NSString *)key withInteger:(NSInteger)number andLocalOnly:(BOOL)localOnly

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

number

The value.

localOnly

If TRUE the user property won’t be sent to the server and thus can only be user for local substitution

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withFloat:andLocalOnly:

Store a float property about the user

- (BOOL)setUserProperty:(NSString *)key withFloat:(float)number andLocalOnly:(BOOL)localOnly

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

number

The value.

localOnly

If TRUE the user property won’t be sent to the server and thus can only be user for local substitution

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withString:andLocalOnly:

Store a string property about the user

- (BOOL)setUserProperty:(NSString *)key withString:(NSString *)string andLocalOnly:(BOOL)localOnly

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

localOnly

If TRUE the user property won’t be sent to the server and thus can only be user for local substitution

number

The value. Pass [NSNull null] to delete a previously existing value

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withGender:andLocalOnly:

Store a gender property about the user

- (BOOL)setUserProperty:(NSString *)key withGender:(B4SCustomerGender)gender andLocalOnly:(BOOL)localOnly

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

localOnly

If TRUE the user property won’t be sent to the server and thus can only be user for local substitution

number

The value. Pass B4SCustomerGender_UNDEFINED to delete a previously existing value

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withArray:andLocalOnly:

Store a Array property about the user

- (BOOL)setUserProperty:(NSString *)key withArray:(NSArray *)array andLocalOnly:(BOOL)localOnly

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

localOnly

If TRUE the user property won’t be sent to the server and thus can only be user for local substitution

number

The value. Pass [NSNull null] to delete a previously existing value. The array cannot contain another array, nor contains types other that NSString, NSNumber, NSDate. All objects inside the array must have the same data type

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– setUserProperty:withDate:andLocalOnly:

Store a date property about the user

- (BOOL)setUserProperty:(NSString *)key withDate:(NSDate *)date andLocalOnly:(BOOL)localOnly

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

localOnly

If TRUE the user property won’t be sent to the server and thus can only be user for local substitution

number

The value. Pass [NSNull null] to delete a previously existing value

Return Value

Returns TRUE, if the value is valid, FALSE otherwise or if more than 20 properties have been set.

Declared In

B4SSingleton.h

– deleteUserProperty:

Deletes an existing user property

- (BOOL)deleteUserProperty:(NSString *)key

Parameters

key

The key is a string. It should use reverse-dns-like notation to be used as a domain. For instance, the user hometown should use a “user.hometown” key

Return Value

Returns TRUE, if the value is valid, FALSE if the key didn’t exist

Declared In

B4SSingleton.h

– userPropertyCount

Get the number of user properties

- (NSUInteger)userPropertyCount

Return Value

Get the number of used user properties of the 20 availables

Declared In

B4SSingleton.h

– enablePushNotifications

Enable the Push notification feature

- (void)enablePushNotifications

Declared In

B4SSingleton.h

  enableStopLocationDetection

@property (nonatomic) BOOL enableStopLocationDetection

– registerPushNotificationDeviceToken:

Complete the registration for Push notifications. This method MUST be called from application:didRegisterForRemoteNotificationsWithDeviceToken: otherwise the device won’t receive Push notifications.

- (void)registerPushNotificationDeviceToken:(NSData *)deviceToken

Parameters

deviceToken

The token passed as a parameter to application:didRegisterForRemoteNotificationsWithDeviceToken:

Declared In

B4SSingleton.h

  displayNotifications

Sets this to FALSE to display the notifications displayed by the SDK. Default value is TRUE Do NOT set this before calling startStandAloneMode or your call will be ignored

@property (nonatomic) BOOL displayNotifications

Declared In

B4SSingleton.h

– notificationFeedback:

This methods must be called from your app delegate application:didReceiveLocalNotification:

- (void)notificationFeedback:(NSDictionary *)userInfo

Parameters

userInfo

The userInfo dictionary received by the application:didReceiveLocalNotification: method

Declared In

B4SSingleton.h

  enablePositionTracking

YES if location tracking is enabled. Default value is YES. Use this to override the value set by the server. This value is ignored if the ATR mode is disabled for your application

@property (nonatomic) BOOL enablePositionTracking

Declared In

B4SSingleton.h

  userHomeCoordinates

The coordinates of the user’s home. If the coordinates cannot be determined, return an invalid value. Use CLLocationCoordinate2DIsValid() ( https://developer.apple.com/reference/corelocation/1423806-cllocationcoordinate2disvalid?language=objc ) to check if coordinate is valid

@property (readonly) CLLocationCoordinate2D userHomeCoordinates

Declared In

B4SSingleton.h

  userWorkplaceCoordinates

The coordinates of the user’s workplace. If the coordinates cannot be determined, return an invalid value. Use CLLocationCoordinate2DIsValid() ( https://developer.apple.com/reference/corelocation/1423806-cllocationcoordinate2disvalid?language=objc ) to check if coordinate is valid

@property (readonly) CLLocationCoordinate2D userWorkplaceCoordinates

Declared In

B4SSingleton.h

+ sharedInstance

Get the SDK singleton

+ (B4SSingleton *)sharedInstance

Return Value

Returns the SDK Singleton or nil if [B4SSingleton setupSharedInstanceWithAppId:] hasn’t been called previously

Declared In

B4SSingleton.h

+ setupSharedInstanceWithAppId:

Initialize the SDK

+ (B4SSingleton *)setupSharedInstanceWithAppId:(NSString *)anAppId

Parameters

anAppId

Your BeaconForStore app ID. Use the Neer.By web manager to get this identifier: https://manager.neer.by

Return Value

The B4S Singleton

Declared In

B4SSingleton.h

+ setupSharedInstance

Initialize the SDK using the App ID found in the ‘Neer.By AppID’ key from the Info.plist. If the key is missing, the SDK will log an error

+ (B4SSingleton *)setupSharedInstance

Return Value

The B4S Singleton

Declared In

B4SSingleton.h

– start

Start to listen to beacons. This method must be called AFTER [B4SSingleton setupSharedInstanceWithAppId:]

- (void)start

Declared In

B4SSingleton.h

– statusForPurpose:

Purpose fully qualified name

- (BOOL)statusForPurpose:(NSString *)purposeName

Parameters

purposeName

Purpose fully qualified name

Return Value

Purpose value, casted as a BOOL. Might return funky results if user property type is not an integer

Declared In

B4SSingleton.h

– setStatus:forPurpose:

- (void)setStatus:(BOOL)status forPurpose:(NSString *)purposeName

– currentShop

Check if the user is currently in a shop

- (B4SShop *)currentShop

Return Value

Nil if the user is not in a shop, a valid B4SShop instance otherwise

Declared In

B4SSingleton.h