MNFUserEvent

Objective-C

@interface MNFUserEvent : MNFObject

Swift

class MNFUserEvent : MNFObject

The MNFUserEvent class encapsulates user event json data from the server in an object.

A user event should not be directly initialized. It is created by fetching a user feed using MNFFeed. A user event will be created as part of a feed data.

  • @abstract The text that species the action on the object

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull actionText;

    Swift

    var actionText: String { get }
  • @abstract The body of the user event which is displayed to the user. For example for a transaction user event: “This is your first transaction here”.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull body;

    Swift

    var body: String { get }
  • @abstract The channel identifier the user event belongs to.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull channelId;

    Swift

    var channelId: NSNumber { get }
  • @abstract The display color of the user event.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull displayColor;

    Swift

    var displayColor: String { get }
  • @abstract The display icon identifier.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull displayIconIdentifier;

    Swift

    var displayIconIdentifier: NSNumber { get }
  • @abstract Event type identifier.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull eventTypeIdentifier;

    Swift

    var eventTypeIdentifier: String { get }
  • @abstract Should exclude the event.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull exclude;

    Swift

    var exclude: NSNumber { get }
  • @abstract Whether the user event is dynamically generated.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull isDynamic;

    Swift

    var isDynamic: NSNumber { get }
  • @abstract Whether the user event is grouped.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull isGrouped;

    Swift

    var isGrouped: NSNumber { get }
  • @abstract The segment the generated user event belongs to if he belongs to a specific segment.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSNumber *segmentId;

    Swift

    var segmentId: NSNumber? { get }
  • @abstract The title of the user event.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull title;

    Swift

    var title: String { get }
  • @abstract A list of topic ids that are connected to the user events. The value is based on the type i.e. for transactions topic id would contain a transaction id

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray *_Nonnull topicId;

    Swift

    var topicId: [Any] { get }
  • @abstract The date of the user event.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSDate *_Nonnull date;

    Swift

    var date: Date { get }
  • @abstract The name of the topic the user event relates to.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull topicName;

    Swift

    var topicName: String { get }
  • @absttract The type of feed item you are working with.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull typeName;

    Swift

    var typeName: String { get }
  • @abstract The data for the given user event.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSDictionary *_Nonnull userEventData;

    Swift

    var userEventData: [AnyHashable : Any] { get }
  • @abstract User event type id

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull userEventTypeId;

    Swift

    var userEventTypeId: NSNumber { get }
  • @abstract The user id the given feed it em is for.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSNumber *_Nonnull userId;

    Swift

    var userId: NSNumber { get }
  • Fetch a user event with an identifier.

    Declaration

    Objective-C

    + (nonnull MNFJob *)fetchWithId:(nonnull NSNumber *)identifier
                         completion:
                             (nullable MNFUserEventCompletionHandler)completion;

    Swift

    class func fetch(withId identifier: NSNumber, completion: MNFUserEventCompletionHandler? = nil) -> MNFJob

    Parameters

    identifier

    The id of the user event.

    completion

    A completion handler with a user event and an error.

    Return Value

    MNFJob A job containing a user event and an error.

  • Fetch a list of user events.

    Declaration

    Objective-C

    + (nonnull MNFJob *)
          fetchFromDate:(nullable NSDate *)from
                 toDate:(nullable NSDate *)to
              topicName:(nullable NSString *)topicName
        typeIdentifiers:(nullable NSString *)typeIdentifier
             completion:(nullable MNFMultipleUserEventsCompletionHandler)completion;

    Swift

    class func fetch(from: Date?, to: Date?, topicName: String?, typeIdentifiers typeIdentifier: String?, completion: MNFMultipleUserEventsCompletionHandler? = nil) -> MNFJob

    Parameters

    from

    The date to filter from.

    to

    The date to filter to.

    topicName

    The topic name of the user events.

    typeIdentifier

    The type identifiers of the user events.

    completion

    A completion handler with a list of user events and an error.

    Return Value

    MNFJob A job containing a list of user events and an error.

  • Subscribe to a list of user events on a given channel.

    Declaration

    Objective-C

    + (nonnull MNFJob *)
        subscribeToUserEvents:
            (nonnull NSArray<NSString *> *)userEventTypeIdentifiers
                    onChannel:(nonnull NSString *)channelName
               withCompletion:(nullable MNFErrorOnlyCompletionHandler)completion;

    Swift

    class func subscribe(toUserEvents userEventTypeIdentifiers: [String], onChannel channelName: String, withCompletion completion: MNFErrorOnlyCompletionHandler? = nil) -> MNFJob

    Parameters

    userEventTypeIdentifiers

    A list of string constants representing the user events to subscribe to. The available userEventTypeIdentifiers can be fetched through ‘fetchEventTypesWithCompletion:’.

    channelName

    The channel through which the user events are deliverd. The available channels are ‘ActivityFeedMobile’,‘Email’ and ‘Push’.

    completion

    A completion block returning an error.

    Return Value

    MNFJob A job containing an error.

  • Unsubscribe from a list of user events on a given channel.

    Declaration

    Objective-C

    + (nonnull MNFJob *)
        unsubscribeFromUserEvents:
            (nonnull NSArray<NSString *> *)userEventTypeIdentifiers
                        onChannel:(nonnull NSString *)channelName
                       withReason:(nullable NSString *)unsubscriptionReason
                       completion:
                           (nullable MNFErrorOnlyCompletionHandler)completion;

    Swift

    class func unsubscribe(fromUserEvents userEventTypeIdentifiers: [String], onChannel channelName: String, withReason unsubscriptionReason: String?, completion: MNFErrorOnlyCompletionHandler? = nil) -> MNFJob

    Parameters

    userEventTypeIdentifiers

    A list of string constants representing the user events to subscribe to. The available userEventTypeIdentifiers can be fetched through ‘fetchEventTypesWithCompletion:’.

    channelName

    The channel through which the user events are deliverd. The available channels are ‘ActivityFeedMobile’,‘Email’ and ‘Push’.

    unsubscriptionReason

    The reason why you are unsubscribing.

    completion

    A completion block returning an error.

    Return Value

    MNFJob A job containing an error.

  • Fetch a list of all feed event type identifiers.

    Declaration

    Objective-C

    + (nonnull MNFJob *)fetchEventTypesWithCompletion:
        (nullable void (^)(NSArray<NSString *> *_Nullable,
                           NSError *_Nullable))completion;

    Swift

    class func fetchTypes(completion: (([String]?, Error?) -> Void)? = nil) -> MNFJob

    Parameters

    completion

    A completion block returning a list of event types and an error.

    Return Value

    MNFJob A job containing a list of event types and an error.