MFBeacon Class Reference

Inherits from NSObject
Declared in MFBeacon.h
MFBeacon.m

Overview

MFBeacon is a custom class that contains specific properties and functions that handle beacon object.

  objectId

Specifies the unique id of MFBeacon object.

@property (strong, nonatomic, readonly, nullable) NSString *objectId

Discussion

This field will be assigned by fetching current object that exists or by saving new user to Mesosfer cloud.

Declared In

MFBeacon.h

  createdAt

Specifies the created timestamp of MFBeacon object.

@property (strong, nonatomic, readonly, nullable) NSDate *createdAt

Discussion

This field will be assigned by fetching current object that exists or by saving new user to Mesosfer cloud.

Declared In

MFBeacon.h

  updatedAt

Specifies the last updated timestamp of MFBeacon object.

@property (strong, nonatomic, readonly, nullable) NSDate *updatedAt

Discussion

This field will be assigned by fetching current object that exists or by saving new user to Mesosfer cloud.

Declared In

MFBeacon.h

  name

Specifies the name of MFBeacon object.

@property (strong, nonatomic, nullable) NSString *name

Declared In

MFBeacon.h

  proximityUUID

Specifies the proximity UUID of MFBeacon object. It represent to company identifier of a beacon.

@property (strong, nonatomic, nullable) NSUUID *proximityUUID

Declared In

MFBeacon.h

  major

Specifies the major number of MFBeacon object. It represent the major identifier of a beacon.

@property (strong, nonatomic, nullable) NSNumber *major

Declared In

MFBeacon.h

  minor

Specifies the minor number of MFBeacon object. It represent the minor identifier of a beacon.

@property (strong, nonatomic, nullable) NSNumber *minor

Declared In

MFBeacon.h

  data

Specifies the custom NSDictionary data of MFBeacon.

@property (strong, nonatomic, readonly, nullable) NSDictionary *data

Declared In

MFBeacon.h

+ beaconWithName:NS_SWIFT_NAME:

Creates a new MFBeacon with a name.

+ (nonnull instancetype)beaconWithName:(nonnull NSString *)name NS_SWIFT_NAME

Parameters

name

A name can be any alphanumeric string that begins with a letter. It represents a unique name for your beacon, like ‘Beacon Front Door’ or ‘Beacon No. 123’.

Return Value

the object beacon that is instantiated with the given name.

Declared In

MFBeacon.h

+ beaconWithObjectId:NS_SWIFT_NAME:

Creates a reference to an existing MFBeacon for use in creating associations between MFBeacons.

+ (nonnull instancetype)beaconWithObjectId:(nonnull NSString *)objectId NS_SWIFT_NAME

Parameters

objectId

The object id for the referenced MFBeacon object.

Return Value

A MFBeacon instance without data.

Discussion

Warning: You need to call MFBeacon.fetchAsyncWithBlock: to fetch object from Mesosfer cloud.

Declared In

MFBeacon.h

+ query

Creates a new MFQuery instance for querying MFBeacon object.

+ (nonnull MFQuery *)query

Return Value

A new MFQuery instance.

Declared In

MFBeacon.h

– dictionary

Gets all key and value pair of MFBeacon object in a dictionary.

- (nullable NSDictionary *)dictionary

Return Value

The dictionary of all key and value pair object.

Declared In

MFBeacon.h

– objectForKey:

Returns the value associated with a given key.

- (nullable id)objectForKey:(nonnull NSString *)key

Parameters

key

The key for which to return the corresponding value.

Declared In

MFBeacon.h

– objectForKeyedSubscript:

Returns the value associated with a given key.

- (nullable id)objectForKeyedSubscript:(nonnull NSString *)key

Parameters

key

The key for which to return the corresponding value.

Discussion

This method enables usage of literal syntax on MFBeacon. E.g. NSString *value = beacon[@"key"];

See Also

Declared In

MFBeacon.h

– removeObjectForKey:

Unsets a key on the object.

- (void)removeObjectForKey:(nonnull NSString *)key

Parameters

key

The key.

Declared In

MFBeacon.h

– setObject:forKey:

Sets the object associated with a given key.

- (void)setObject:(nonnull id)object forKey:(nonnull NSString *)key

Parameters

object

The object for key. A strong reference to the object is maintained by MFBeacon. Raises an NSInvalidArgumentException if object is nil. If you need to represent a nil value - use NSNull.

key

The key for object. Raises an NSInvalidArgumentException if key is nil.

Declared In

MFBeacon.h

– setObject:forKeyedSubscript:

Returns the value associated with a given key.

- (void)setObject:(nonnull id)object forKeyedSubscript:(nonnull NSString *)key

Parameters

object

The object for key. A strong reference to the object is maintained by MFBeacon. Raises an NSInvalidArgumentException if object is nil. If you need to represent a nil value - use NSNull.

key

The key for object. Raises an NSInvalidArgumentException if key is nil.

Discussion

This method enables usage of literal syntax on MFBeacon. E.g. beacon[@"key"] = @"value";

Declared In

MFBeacon.h

– fetchAsyncWithBlock:

Fetch the current MFBeacon data from Mesosfer cloud asynchronously and executes the given callback block.

- (void)fetchAsyncWithBlock:(nullable MFObjectResultBlock)block

Parameters

block

The block to execute. It shoud have the following argument signature: ^(MFBeacon *beacon, NSError *error).

Declared In

MFBeacon.h

– saveAsyncWithBlock:

Saves the MFBeacon asynchronously and executes the given callback block.

- (void)saveAsyncWithBlock:(nullable MFBooleanResultBlock)block

Parameters

block

The block to execute. It should have the following argument signature: ^(BOOL succeeded, NSError *error).

Declared In

MFBeacon.h

– deleteAsyncWithBlock:

Delete the MFBeacon object in Mesosfer cloud asynchronously and executes the given callback block.

- (void)deleteAsyncWithBlock:(nullable MFBooleanResultBlock)block

Parameters

block

The block to execute. It should have the following argument signature: ^(BOOL succeeded, NSError *error).

Declared In

MFBeacon.h