B4SSingleton Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | B4SSingleton.h |
delegate
The delegate
@property (nonatomic, weak) id<B4SDelegate> delegateDeclared 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 beaconBackgroundScanEnabledDeclared 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 *notificationSoundnameDeclared 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)numberParameters
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)numberParameters
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 *)stringParameters
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)genderParameters
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 *)arrayParameters
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 *)dateParameters
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)localOnlyParameters
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)localOnlyParameters
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)localOnlyParameters
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)localOnlyParameters
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)localOnlyParameters
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)localOnlyParameters
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 *)keyParameters
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)userPropertyCountReturn Value
Get the number of used user properties of the 20 availables
Declared In
B4SSingleton.h
– enablePushNotifications
Enable the Push notification feature
- (void)enablePushNotificationsDeclared In
B4SSingleton.h
– 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 *)deviceTokenParameters
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 displayNotificationsDeclared In
B4SSingleton.h
– notificationFeedback:
This methods must be called from your app delegate application:didReceiveLocalNotification:
- (void)notificationFeedback:(NSDictionary *)userInfoParameters
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 enablePositionTrackingDeclared 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 userHomeCoordinatesDeclared 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 userWorkplaceCoordinatesDeclared In
B4SSingleton.h
+ sharedInstance
Get the SDK singleton
+ (B4SSingleton *)sharedInstanceReturn 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 *)anAppIdParameters
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 *)setupSharedInstanceReturn Value
The B4S Singleton
Declared In
B4SSingleton.h
– start
Start to listen to beacons. This method must be called AFTER [B4SSingleton setupSharedInstanceWithAppId:]
- (void)startDeclared In
B4SSingleton.h
– statusForPurpose:
Purpose fully qualified name
- (BOOL)statusForPurpose:(NSString *)purposeNameParameters
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
– currentShop
Check if the user is currently in a shop
- (B4SShop *)currentShopReturn Value
Nil if the user is not in a shop, a valid B4SShop instance otherwise
Declared In
B4SSingleton.h