MFNotification Class Reference

Inherits from NSObject
Declared in MFNotification.h
MFNotification.m

Overview

MFNotification is a custom class that used for storing notification data. This is a simple representation of MFStoryline object.

  objectId

Specifies the unique id of MFNotification 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

MFNotification.h

  createdAt

Specifies the created timestamp of MFNotification 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

MFNotification.h

  updatedAt

Specifies the last updated timestamp of MFNotification 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

MFNotification.h

  event

Specifies the beacon event of MFNotification object.

@property (assign, nonatomic) MFBeaconEvent event

Declared In

MFNotification.h

  type

Specifies the notification type of MFNotification object.

@property (assign, nonatomic) MFNotificationType type

Declared In

MFNotification.h

  notifDescription

Specifies the description of MFNotification object.

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

Declared In

MFNotification.h

  isEnabled

Specifies the state of MFNotification object whether it is enabled or disabled.

@property (assign, nonatomic) BOOL isEnabled

Declared In

MFNotification.h

  beacon

Specifies a MFBeacon object of notification.

@property (strong, nonatomic, nullable) MFBeacon *beacon

Declared In

MFNotification.h

  data

Specifies the custom NSDictionary data of MFNotification.

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

Declared In

MFNotification.h

+ notificationWithBeacon:NS_SWIFT_NAME:

Creates a new MFNotification with a MFNotification object.

+ (nonnull instancetype)notificationWithBeacon:(nonnull MFBeacon *)beacon NS_SWIFT_NAME

Parameters

beacon

A MFNotification object of notification.

Return Value

A MFNotification object that is instantiated with the given MFNotification object.

Declared In

MFNotification.h

+ notificationWithBeaconId:NS_SWIFT_NAME:

Creates a new MFNotification with a MFNotification objectId.

+ (nonnull instancetype)notificationWithBeaconId:(nonnull NSString *)beaconId NS_SWIFT_NAME

Parameters

beaconId

The object id for the MFNotification object.

Return Value

A MFNotification object that is instantiated with the given MFNotification objectId.

Declared In

MFNotification.h

+ notificationWithObjectId:NS_SWIFT_NAME:

Creates a reference to an existing MFNotification for use in creating associations between MFNotifications.

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

Parameters

objectId

The object id for the referenced MFNotification object.

Return Value

A MFNotification instance without data.

Discussion

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

Declared In

MFNotification.h

+ query

Creates a new MFQuery instance for querying MFNotification object.

+ (nonnull MFQuery *)query

Return Value

A new MFQuery instance.

Declared In

MFNotification.h

– dictionary

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

- (nullable NSDictionary *)dictionary

Return Value

The dictionary of all key and value pair object.

Declared In

MFNotification.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

MFNotification.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 MFNotification. E.g. NSString *value = user[@"key"];

See Also

Declared In

MFNotification.h

– removeObjectForKey:

Unsets a key on the object.

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

Parameters

key

The key.

Declared In

MFNotification.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 MFNotification. 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

MFNotification.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 MFNotification. 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 MFNotification. E.g. user[@"key"] = @"value";

Declared In

MFNotification.h

– fetchAsyncWithBlock:

Fetch the current MFNotification 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: ^(MFNotification *notification, NSError *error).

Declared In

MFNotification.h

– saveAsyncWithBlock:

Saves the MFNotification 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

MFNotification.h

– deleteAsyncWithBlock:

Delete the MFNotification 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

MFNotification.h