EMBSubscriptionPurchaseFlow
@interface EMBSubscriptionPurchaseFlow : EMBCustomFlow
This class is responsible for tracking app performance during subscription purchase flows.
This class is thread-safe.
-
Starts a subscription purchase moment.
This method should be called as soon as the user indicates an intent to purchase a subscription. This means that all information pertaining to the purchase (e.g. billing, payment, shipping) should already be known prior to invoking this method.
Declaration
Objective-C
- (nonnull NSString *) subscriptionPurchaseStartWithOrderId:(nullable NSString *)orderId subscriptionType:(nullable NSString *)subscriptionType amount:(nullable NSNumber *)amount paymentType:(nullable NSString *)paymentType properties:(nullable EMBProperties *)properties;
Swift
func subscriptionPurchaseStart(withOrderId orderId: String?, subscriptionType: String?, amount: NSNumber?, paymentType: String?, properties: [String : String]?) -> String
Parameters
orderId
The ID that represents the subscription purchase order. This value is optional and, if present, will associate the value as a property of the moment.
subscriptionType
The recurrence factor (e.g. monthly, annual) of the subscription purchase. This value is optional and, if present, will associate the value as a property of the moment.
amount
The total amount of the subscription purchase. This value is optional and, if present, will associate the value as a property of the moment.
paymentType
The payment system that will be fulfilling the subscription purchase (e.g. Google IAB, PayPal, BrainTree). This value is optional and, if present, will associate the value as a property 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 (not including the ones set via arguments to this method) may be set.
Return Value
True if the operation was successful; false otherwise.
-
Ends the subscription purchase moment and generates an info log message that indicates that the subscription purchase completed.
This method should be called once the subscription purchase has been confirmed.
Declaration
Objective-C
- (BOOL)subscriptionPurchaseComplete;
Swift
func subscriptionPurchaseComplete() -> Bool
Return Value
True if the operation was successful; false otherwise.
-
Ends the subscription purchase moment and generates an info log message that indicates that the subscription purchase completed.
This method should be called once the subscription purchase has been confirmed.
Declaration
Objective-C
- (BOOL)subscriptionPurchaseCompleteWithProperties: (nullable EMBProperties *)properties;
Swift
func subscriptionPurchaseComplete(withProperties properties: [String : String]?) -> Bool
Parameters
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 (not including the ones set via arguments to this method) may be set.
Return Value
True if the operation was successful; false otherwise.
-
Ends the subscription purchase moment and generates an error log message that indicates that the subscription purchase failed.
This method should be called once the subscription purchase has been confirmed.
Declaration
Objective-C
- (BOOL)subscriptionPurchaseFailWithMessage:(nullable NSString *)message;
Swift
func subscriptionPurchaseFail(withMessage message: String?) -> Bool
Parameters
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.
-
Ends the subscription purchase moment and generates an error log message that indicates that the subscription purchase failed.
This method should be called once the subscription purchase has been confirmed.
Declaration
Objective-C
- (BOOL)subscriptionPurchaseFailWithMessage:(nullable NSString *)message properties: (nullable EMBProperties *)properties;
Swift
func subscriptionPurchaseFail(withMessage message: String?, properties: [String : String]?) -> Bool
Parameters
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 (not including the ones set via arguments to this method) may be set.
Return Value
True if the operation was successful; false otherwise.