Answers

@interface Answers : NSObject

This class exposes the Answers Events API, allowing you to track key user user actions and metrics in your app.

  • Log a Sign Up event to see users signing up for your app in real-time, understand how many users are signing up with different methods and their success rate signing up.

    Declaration

    Swift

    class func logSignUp(withMethod signUpMethodOrNil: String?, success signUpSucceededOrNil: NSNumber?, customAttributes customAttributesOrNil: [AnyHashable : Any]? = nil)

    Objective-C

    + (void)logSignUpWithMethod:(nullable NSString *)signUpMethodOrNil
                        success:(nullable NSNumber *)signUpSucceededOrNil
               customAttributes:(nullable NSDictionary *)customAttributesOrNil;

    Parameters

    signUpMethodOrNil

    The method by which a user logged in, e.g. Twitter or Digits.

    signUpSucceededOrNil

    The ultimate success or failure of the login

    customAttributesOrNil

    A dictionary of custom attributes to associate with this event.

  • Log an Log In event to see users logging into your app in real-time, understand how many users are logging in with different methods and their success rate logging into your app.

    Declaration

    Swift

    class func logLogin(withMethod loginMethodOrNil: String?, success loginSucceededOrNil: NSNumber?, customAttributes customAttributesOrNil: [AnyHashable : Any]? = nil)

    Objective-C

    + (void)logLoginWithMethod:(nullable NSString *)loginMethodOrNil
                       success:(nullable NSNumber *)loginSucceededOrNil
              customAttributes:(nullable NSDictionary *)customAttributesOrNil;

    Parameters

    loginMethodOrNil

    The method by which a user logged in, e.g. email, Twitter or Digits.

    loginSucceededOrNil

    The ultimate success or failure of the login

    customAttributesOrNil

    A dictionary of custom attributes to associate with this event.

  • Log a Share event to see users sharing from your app in real-time, letting you understand what content they’re sharing from the type or genre down to the specific id.

    Declaration

    Swift

    class func logShare(withMethod shareMethodOrNil: String?, contentName contentNameOrNil: String?, contentType contentTypeOrNil: String?, contentId contentIdOrNil: String?, customAttributes customAttributesOrNil: [AnyHashable : Any]? = nil)

    Objective-C

    + (void)logShareWithMethod:(nullable NSString *)shareMethodOrNil
                   contentName:(nullable NSString *)contentNameOrNil
                   contentType:(nullable NSString *)contentTypeOrNil
                     contentId:(nullable NSString *)contentIdOrNil
              customAttributes:(nullable NSDictionary *)customAttributesOrNil;

    Parameters

    shareMethodOrNil

    The method by which a user shared, e.g. email, Twitter, SMS.

    contentNameOrNil

    The human readable name for this piece of content.

    contentTypeOrNil

    The type of content shared.

    contentIdOrNil

    The unique identifier for this piece of content. Useful for finding the top shared item.

    customAttributesOrNil

    A dictionary of custom attributes to associate with this event.

  • Log an Invite Event to track how users are inviting other users into your application.

    Declaration

    Swift

    class func logInvite(withMethod inviteMethodOrNil: String?, customAttributes customAttributesOrNil: [AnyHashable : Any]? = nil)

    Objective-C

    + (void)logInviteWithMethod:(nullable NSString *)inviteMethodOrNil
               customAttributes:(nullable NSDictionary *)customAttributesOrNil;

    Parameters

    inviteMethodOrNil

    The method of invitation, e.g. GameCenter, Twitter, email.

    customAttributesOrNil

    A dictionary of custom attributes to associate with this event.

  • Log a Purchase event to see your revenue in real-time, understand how many users are making purchases, see which items are most popular, and track plenty of other important purchase-related metrics.

    Declaration

    Swift

    class func logPurchase(withPrice itemPriceOrNil: NSDecimalNumber?, currency currencyOrNil: String?, success purchaseSucceededOrNil: NSNumber?, itemName itemNameOrNil: String?, itemType itemTypeOrNil: String?, itemId itemIdOrNil: String?, customAttributes customAttributesOrNil: [AnyHashable : Any]? = nil)

    Objective-C

    + (void)logPurchaseWithPrice:(nullable NSDecimalNumber *)itemPriceOrNil
                        currency:(nullable NSString *)currencyOrNil
                         success:(nullable NSNumber *)purchaseSucceededOrNil
                        itemName:(nullable NSString *)itemNameOrNil
                        itemType:(nullable NSString *)itemTypeOrNil
                          itemId:(nullable NSString *)itemIdOrNil
                customAttributes:(nullable NSDictionary *)customAttributesOrNil;

    Parameters

    itemPriceOrNil

    The purchased item’s price.

    currencyOrNil

    The ISO4217 currency code. Example: USD

    purchaseSucceededOrNil

    Was the purchase successful or unsuccessful

    itemNameOrNil

    The human-readable form of the item’s name. Example:

    itemTypeOrNil

    The type, or genre of the item. Example: Song

    itemIdOrNil

    The machine-readable, unique item identifier Example: SKU

    customAttributesOrNil

    A dictionary of custom attributes to associate with this purchase.

  • Log a Level Start Event to track where users are in your game.

    Declaration

    Swift

    class func logLevelStart(_ levelNameOrNil: String?, customAttributes customAttributesOrNil: [AnyHashable : Any]? = nil)

    Objective-C

    + (void)logLevelStart:(nullable NSString *)levelNameOrNil
         customAttributes:(nullable NSDictionary *)customAttributesOrNil;

    Parameters

    levelNameOrNil

    The level name

    customAttributesOrNil

    A dictionary of custom attributes to associate with this level start event.

  • Log a Level End event to track how users are completing levels in your game.

    D