Classes

The following classes are available globally.

  • AWSMobileAnalyticsAppleMonetizationEventBuilder builds monetization events to track purchases from Apple’s IAP Framework. In order to build a monetization event, you must call all of the setters on this builder. You will need to access properties on both the SKProduct class and the SKPurchaseTransaction class in order to build an Apple Monetization event.

    The example below demonstrates how to create a monetization event after you recieve a SKPaymentTransaction from the SKPaymentTransactionObserver. Since Apple does not give you any product information in the SKPaymentTransaction object, you must have a way to access your SKProduct store inventory when the purchase is being finalized. In the example below, we have a product catalog object that can return SKProduct’s based on the product id returned in an SKPaymentTransaction object. This product catalog was built after receiving a SKProductsRequest from the SKProductsRequestDelegate.

    Example:

    -(void)paymentQueue:(SKPaymentQueue )queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction transaction in transactions) { switch (transaction.transactionState) { case SKPaymentTransactionStatePurchased:

          // when an item is purchased, give the user access to the content, and
          // record a monetization purchase event.
          [self completeTransaction:transaction];
             break;
          case SKPaymentTransactionStateFailed:
             // ... handle a failed transaction
             break;
          case SKPaymentTransactionStateRestored:
             // ... restore the transaction
             break;
       }
    }
    

    }

    -(void)completeTransaction:(SKPaymentTransaction*)transaction{ // provide the content that the user purchased [self provideContentForProductIdentifier:transaction.payment.productIdentifier];

    // get the SKProduct for the product identifier that was purchased
    SKProduct* product = [productCatalog objectForKey:transaction.payment.productIdentifier];
    
    // get the event client for the builder
    id<AWSMobileAnalyticsEventClient> eventClient = insights.eventClient;
    
    // create a builder that can record purchase events from Apple
    AWSMobileAnalyticsAppleMonetizationEventBuilder* builder = [AWSMobileAnalyticsAppleMonetizationEventBuilder builderWithEventClient:eventClient];
    
    // set the product id of the purchased item (obtained from the SKPurchaseTransaction object)
    [builder withProductId:transaction.payment.productIdentifier];
    
    // set the item price and price locale (obtained from the SKProduct object)
    [builder withItemPrice:[product.price doubleValue]
            andPriceLocale:product.priceLocale];
    
    // set the quantity of item(s) purchased (obtained from the SKPurchaseTransaction object)
    [builder withQuantity:transaction.payment.quantity];
    
    // set the transactionId of the transaction (obtained from the SKPurchaseTransaction object)
    [builder withTransactionId:transaction.transactionIdentifier];
    
    // build the monetization event
    id<AWSMobileAnalyticsEvent> purchaseEvent = [builder build];
    
    // add any additional metrics/attributes and record
    [eventClient recordEvent:purchaseEvent];
    
    // finalize the transaction as required by Apple
    [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
    

    }

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsAppleMonetizationEventBuilder
        : AWSMobileAnalyticsMonetizationEventBuilder

    Swift

    class AWSMobileAnalyticsAppleMonetizationEventBuilder : AWSMobileAnalyticsMonetizationEventBuilder
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsEnvironment : NSObject
    
    @property (nonatomic, strong) NSString *appVersion;
    @property (nonatomic, strong) NSString *appBuild;
    @property (nonatomic, strong) NSString *appPackageName;
    @property (nonatomic, strong) NSString *appName;
    
    @end

    Swift

    class AWSMobileAnalyticsEnvironment : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsConfiguration : NSObject
    
    @property (nonatomic, assign) BOOL useHttps;
    @property (nonatomic, strong) NSDictionary *attributes;
    @property (nonatomic, strong) AWSMobileAnalyticsEnvironment *environment;
    @property (nonatomic, assign) BOOL transmitOnWAN;
    @property (nonatomic, assign) BOOL enableEvents;
    @property (nonatomic, assign) AWSAppIdentificationStrategy identificationStrategy;
    @property (nonatomic, copy) AWSServiceConfiguration *serviceConfiguration;
    
    @end

    Swift

    class AWSMobileAnalyticsConfiguration : NSObject
  • Represents a single event that happened on a client device. Attributes and metrics are optional. Required parameters: [eventType, timestamp, session]

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsERSEvent

    Swift

    class AWSMobileAnalyticsERSEvent
  • Describes a set of events Required parameters: [events, clientContext]

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsERSPutEventsInput

    Swift

    class AWSMobileAnalyticsERSPutEventsInput
  • Declaration

    Objective-C

    @interface AWSMobileAnalyticsERSSession

    Swift

    class AWSMobileAnalyticsERSSession
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsERSResources : NSObject
    
    + (instancetype)sharedInstance;
    
    - (NSDictionary *)JSONObject;
    
    @end

    Swift

    class AWSMobileAnalyticsERSResources : NSObject
  • A service which is used to record Amazon Mobile Analytics events

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsERS

    Swift

    class AWSMobileAnalyticsERS
  • Base class for handling the required attributes and metrics for monetization Events. This class is not meant to be instantiated. Instead, create instances specific to the purchase you are trying to record. Currently, AWSMobileAnalyticsVirtualMonetizationEventBuilder is used to create monetization events for virtual purchases, and AWSMobileAnalyticsAppleMonetizationEventBuilder is used to create monetization events for purchases with Apple’s IAP framework.

    This class can be extended if you need to record monetization events from other purchase frameworks. Derived classes must override the AWSMobileAnalyticsMonetizationEventBuilder::isValid method so that AWSMobileAnalyticsMonetizationEventBuilder knows if the derived builder is in a valid state.

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsMonetizationEventBuilder : NSObject

    Swift

    class AWSMobileAnalyticsMonetizationEventBuilder : NSObject
  • Deprecated

    Use AWSPinpoint for analytics.

    Amazon Mobile Analytics client.

    Warning

    The AWSMobileAnalytics SDK is deprecated. Please use AWSPinpoint for analytics. @deprecated Please use AWSPinpoint for analytics.
    See more

    Declaration

    Objective-C

    
    @interface AWSMobileAnalytics : NSObject

    Swift

    class AWSMobileAnalytics : NSObject
  • AWSMobileAnalyticsVirtualMonetizationEventBuilder builds monetization events to track virtual purchases from your In-Game store. In order to build a Virtual monetization event, you must call all of the setters on this builder.

    The example below shows how to record a monetization event for the purchase of 1 sword that costs 500 Gold.

    id eventClient = insights.eventClient;

    // create a builder that can record purchase events from your In-Game Store AWSMobileAnalyticsVirtualMonetizationEventBuilder* builder = [AWSMobileAnalyticsVirtualMonetizationEventBuilder builderWithEventClient:eventClient];

    // set the product id of the purchased item [builder withProductId:@“com.yourgame.sword”];

    // set the item price [builder withItemPrice:500];

    // set the currency of the item price [builder withCurrency:@“Gold”];

    // set the quantity of item(s) purchased [builder withQuantity:1];

    // build/record the monetization event id virtualPurchaseEvent = [builder build]; [eventClient recordEvent:virtualPurchaseEvent];

    See more

    Declaration

    Objective-C

    @interface AWSMobileAnalyticsVirtualMonetizationEventBuilder
        : AWSMobileAnalyticsMonetizationEventBuilder

    Swift

    class AWSMobileAnalyticsVirtualMonetizationEventBuilder : AWSMobileAnalyticsMonetizationEventBuilder