EMBCustomFlow

@interface EMBCustomFlow : NSObject

Base class for creating custom domain-specific flows that are essentially convenience wrappers around existing SDK functionality.

  • Creates an EMBCustomFlow instance.

    Declaration

    Objective-C

    + (nonnull instancetype)flow;
  • Starts a custom moment.

    Declaration

    Objective-C

    - (nullable NSString *)momentStartWithName:(nonnull NSString *)momentName
                               allowScreenshot:(BOOL)allowScreenshot
                                    properties:(nullable EMBProperties *)properties;

    Swift

    func momentStart(withName momentName: String, allowScreenshot: Bool, properties: [String : String]?) -> String?

    Parameters

    momentName

    The name of the moment.

    allowScreenshot

    If true, a screenshot will be taken if the moment exceeds the late threshold. If this value is false, a screenshot will be not be taken regardless of the moment duration.

    properties

    A map of Strings to Objects that represent additional properties to associate with the moment. This value is optional. A maximum of 10 properties may be set.

    Return Value

    A moment identifier that uniquely identifies the newly started moment instance.

  • Completes all started instances of the specified custom moment.

    Note that only moment instances managed by this Flow object will be completed. In other words, if another Flow instance starts a moment with the same name, completing the moment on this instance will not affect it.

    Declaration

    Objective-C

    - (BOOL)momentCompleteWithName:(nonnull NSString *)momentName;

    Swift

    func momentComplete(withName momentName: String) -> Bool

    Parameters

    momentName

    The name of the moment.

    Return Value

    True if the operation was successful; false otherwise.

  • Completes all started instances of the specified custom moment.

    Note that only moment instances managed by this Flow object will be completed. In other words, if another Flow instance starts a moment with the same name, completing the moment on this instance will not affect it.

    Declaration

    Objective-C

    - (BOOL)momentCompleteWithName:(nonnull NSString *)momentName
                        properties:(nullable EMBProperties *)properties;

    Swift

    func momentComplete(withName momentName: String, properties: [String : String]?) -> Bool

    Parameters

    momentName

    The name of the moment.

    properties

    A map of Strings to Objects that represent additional properties to associate with the moment. This value is optional. A maximum of 10 properties may be set.

    Return Value

    True if the operation was successful; false otherwise.

  • Completes a started instance of the custom moment specified by the moment identifier.

    Note that only moment instances managed by this Flow object will be completed. In other words, if another Flow instance starts a moment with the same name, completing the moment on this instance will not affect it.

    Declaration

    Objective-C

    - (BOOL)momentCompleteWithName:(nonnull NSString *)momentName
                          momentId:(nullable NSString *)momentId;

    Swift

    func momentComplete(withName momentName: String, momentId: String?) -> Bool

    Parameters

    momentName

    The name of the moment.

    momentId

    The optional moment identifier returned by the momentStart method. This moment identifier must be an identifier produced by this particular Flow instance that has not already been completed or failed. This value can also be null, in which case all instances of the given moment name registered with this Flow instance will be completed.

    Return Value

    True if the operation was successful; false otherwise.

  • Completes a started instance of the custom moment specified by the moment identifier.

    Note that only moment instances managed by this Flow object will be completed. In other words, if another Flow instance starts a moment with the same name, completing the moment on this instance will not affect it.

    Declaration

    Objective-C

    - (BOOL)momentCompleteWithName:(nonnull NSString *)momentName
                          momentId:(nullable NSString *)momentId
                        properties:(nullable EMBProperties *)properties;

    Swift

    func momentComplete(withName momentName: String, momentId: String?, properties: [String : String]?) -> Bool

    Parameters

    momentName

    The name of the moment.

    momentId

    The optional moment identifier returned by the momentStart method. This moment identifier must be an identifier produced by this particular Flow instance that has not already been completed or failed. This value can also be null, in which case all instances of the given moment name registered with this Flow instance will be completed.

    properties

    A map of Strings to Objects that represent additional properties to associate with the moment. This value is optional. A maximum of 10 properties may be set.

    Return Value

    True if the operation was successful; false otherwise.

  • Fails all started instances of the specified custom moment and generates an error log message for each failed moment instance.

    Note that only moment instances managed by this Flow object will be failed. In other words, if another Flow instance fails a moment with the same name, failing the moment on this instance will not affect it.

    Declaration

    Objective-C

    - (BOOL)momentFailWithName:(nonnull NSString *)momentName
                       message:(nullable NSString *)message;

    Swift

    func momentFail(withName momentName: String, message: String?) -> Bool

    Parameters

    momentName

    The name of the moment.

    message

    A message that explains the reason for why this operation failed. This value is optional and, if provided, will associate the value as a property of the error log message.

    Return Value

    True if the operation was successful; false otherwise.

  • Fails all started instances of the specified custom moment and generates an error log message for each failed moment instance.

    Note that only moment instances managed by this Flow object will be failed. In other words, if another Flow instance fails a moment with the same name, failing the moment on this instance will not affect it.

    Declaration

    Objective-C

    - (BOOL)momentFailWithName:(nonnull NSString *)momentName
                       message:(nullable NSString *)message
                    properties:(nullable EMBProperties *)properties;

    Swift

    func momentFail(withName momentName: String, message: String?, properties: [String : String]?) -> Bool

    Parameters

    momentName

    The name of the moment.

    message

    A message that explains the reason for why this operation failed. This value is optional and, if provided, will associate the value as a property of the error log message.

    properties

    A map of Strings to Objects that represent additional properties to associate with the moment. This value is optional. A maximum of 10 properties may be set.

    Return Value

    True if the operation was successful; false otherwise.

  • Fails a started instance of the custom moment specified by the moment identifier and sends an error log message for the failed moment instance.

    Note that only moment instances managed by this Flow object will be failed. In other words, if another Flow instance fails a moment with the same name, failing the moment on this instance will not affect it.

    Declaration

    Objective-C

    - (BOOL)momentFailWithName:(nonnull NSString *)momentName
                      momentId:(nullable NSString *)momentId
                       message:(nullable NSString *)message;

    Swift

    func momentFail(withName momentName: String, momentId: String?, message: String?) -> Bool

    Parameters

    momentName

    The name of the moment.

    momentId

    The optional moment identifier returned by the momentStart method. This moment identifier must be an identifier produced by this particular Flow instance that has not already been completed or failed. This value can also be null, in which case all instances of the given moment name registered with this Flow instance will be completed.

    message

    A message that explains the reason for why this operation failed. This value is optional and, if provided, will associate the value as a property of the error log message.

    Return Value

    True if the operation was successful; false otherwise.

  • Fails a started instance of the custom moment specified by the moment identifier and sends an error log message for the failed moment instance.

    Note that only moment instances managed by this Flow object will be failed. In other words, if another Flow instance fails a moment with the same name, failing the moment on this instance will not affect it.

    Declaration

    Objective-C

    - (BOOL)momentFailWithName:(nonnull NSString *)momentName
                      momentId:(nullable NSString *)momentId
                       message:(nullable NSString *)message
                    properties:(nullable EMBProperties *)properties;

    Swift

    func momentFail(withName momentName: String, momentId: String?, message: String?, properties: [String : String]?) -> Bool

    Parameters

    momentName

    The name of the moment.

    momentId

    The optional moment identifier returned by the momentStart method. This moment identifier must be an identifier produced by this particular Flow instance that has not already been completed or failed. This value can also be null, in which case all instances of the given moment name registered with this Flow instance will be completed.

    message

    A message that explains the reason for why this operation failed. This value is optional and, if provided, will associate the value as a property of the error log message.

    properties

    A map of Strings to Objects that represent additional properties to associate with the moment. This value is optional. A maximum of 10 properties may be set.

    Return Value

    True if the operation was successful; false otherwise.