AWSPinpointEvent

Objective-C

@interface AWSPinpointEvent : NSObject

Swift

class AWSPinpointEvent : NSObject

Represents an analytics event. An event must have an event type.

  • Returns the name/type of this AWSPinpointEvent.

    @returns the name/type of this AWSPinpointEvent.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull eventType;

    Swift

    var eventType: String { get }
  • Returns the timestamp of the event.

    @returns the timestamp of this AWSPinpointEvent.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UTCTimeMillis eventTimestamp;

    Swift

    var eventTimestamp: UTCTimeMillis { get }
  • Returns the session of the event. The session should be populated with the current session in AWSPinpointSessionClient. If no session exists a session is started.

    @returns the session of this AWSPinpointEvent.

    Declaration

    Objective-C

    @property (nonatomic, readonly) AWSPinpointSession *_Nonnull session;

    Swift

    var session: AWSPinpointSession { get }
  • Initializes an event object with specified type and the current timestamp.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithEventType:(nonnull NSString *)theEventType
                                      session:(nonnull AWSPinpointSession *)session;

    Swift

    init(eventType theEventType: String, session: AWSPinpointSession)

    Parameters

    theEventType

    The name/type of the event.

    session

    The session object. Should be retrieved from AWSPinpointSessionClient

  • Initializes an event object with specified type and timestamp.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithEventType:(nonnull NSString *)theEventType
                               eventTimestamp:(UTCTimeMillis)theEventTimestamp
                                      session:(nonnull AWSPinpointSession *)session;

    Swift

    init(eventType theEventType: String, eventTimestamp theEventTimestamp: UTCTimeMillis, session: AWSPinpointSession)

    Parameters

    theEventType

    The name/type of the event.

    theEventTimestamp

    The timestamp of the event.

    session

    The session object. Should be retrieved from AWSPinpointSessionClient

  • Adds an attribute to this AWSPinpointEvent with the specified key. Only 40 attributes. are allowed to be added to an AWSPinpointEvent. If 40 attributes already exist on this AWSPinpointEvent, the call is ignored.

    Declaration

    Objective-C

    - (void)addAttribute:(nonnull NSString *)theValue
                  forKey:(nonnull NSString *)theKey;

    Swift

    func addAttribute(_ theValue: String, forKey theKey: String)

    Parameters

    theValue

    The value of the attribute. The value will be truncated if it exceeds 200 characters.

    theKey

    The key of the attribute. The key will be truncated if it exceeds 50 characters.

  • Adds a metric to this AWSPinpointEvent with the specified key. Only 40 metrics. are allowed to be added to an AWSPinpointEvent. If 40 metrics already exist on this AWSPinpointEvent, the call is ignored.

    Declaration

    Objective-C

    - (void)addMetric:(nonnull NSNumber *)theValue
               forKey:(nonnull NSString *)theKey;

    Swift

    func addMetric(_ theValue: NSNumber, forKey theKey: String)

    Parameters

    theValue

    The value of the metric.

    theKey

    The key of the metric. The key will be truncated if it exceeds 50 characters.

  • Returns the value of the attribute with the specified key.

    Declaration

    Objective-C

    - (nonnull NSString *)attributeForKey:(nonnull NSString *)theKey;

    Swift

    func attribute(forKey theKey: String) -> String

    Parameters

    theKey

    The key of the attribute to return. @returns The attribute with the specified key, or null if attribute does not exist.

  • Returns the value of the metric with the specified key.

    Declaration

    Objective-C

    - (nonnull NSNumber *)metricForKey:(nonnull NSString *)theKey;

    Swift

    func metric(forKey theKey: String) -> NSNumber

    Parameters

    theKey

    The key of the metric to return. @returns The metric with the specified key, or null if metric does not exist.

  • Determines if this AWSPinpointEvent contains a specific attribute.

    Declaration

    Objective-C

    - (BOOL)hasAttributeForKey:(nonnull NSString *)theKey;

    Swift

    func hasAttribute(forKey theKey: String) -> Bool

    Parameters

    theKey

    The key of the attribute @returns YES if this AWSPinpointEvent has an attribute with the specified key, NO otherwise.

  • Determines if this AWSPinpointEvent contains a specific metric.

    Declaration

    Objective-C

    - (BOOL)hasMetricForKey:(nonnull NSString *)theKey;

    Swift

    func hasMetric(forKey theKey: String) -> Bool

    Parameters

    theKey

    The key of the metric @returns YES if this AWSPinpointEvent has a metric with the specified key, NO otherwise.

  • Returns an NSDictionary of all attributes contained within this AWSPinpointEvent.

    @returns an NSDictionary of all attributes, where the attribute keys are the keys and the attribute values are the values.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)allAttributes;

    Swift

    func allAttributes() -> [AnyHashable : Any]
  • Returns an NSDictionary of all metrics contained within this AWSPinpointEvent.

    @returns an NSDictionary of all metrics, where the metric keys are the keys and the metric values are the values.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)allMetrics;

    Swift

    func allMetrics() -> [AnyHashable : Any]
  • Returns an NSDictionary representation of this object.

    @returns an NSDictionary representation of this AWSPinpointEvent object.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)toDictionary;

    Swift

    func toDictionary() -> [AnyHashable : Any]