Ignite Tools
UASubscriptionManager Class Reference

This class provides the primary interface for interacting with the Urban Airship subscription functionality. More...

#import <UASubscriptionManager.h>

Inheritance diagram for UASubscriptionManager:
UAObservable

List of all members.

Properties

Inventory

---------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------

UASubscriptionInventoryinventory
 The inventory of subscriptions (and their products and contents)
UASubscriptionProductpendingProduct
Downloads

---------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------

UASubscriptionDownloadManagerdownloadManager

Singleton

---------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------

(UASubscriptionManager *) + shared
 Singleton initializer.
(void) - forceRelease

UI and Initialization

---------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------

(void) + useCustomUI:
(void) + displaySubscription:animated:
(void) + hideSubscription
(void) + land
(BOOL) + setDownloadDirectory:
 Set a custom download directory, creating it if necessary.
(BOOL) + setDownloadDirectory:withProductIDSubdir:
 Set a custom download directory.
(Class) - uiClass

Purchase and Restore Subscriptions

---------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------

UASubscriptionObservertransactionObserver
(void) - purchase:
 Purchase a subscription product.
(void) - purchaseProductWithId:
 Purchase a subscription product.
(void) - setPendingSubscription:
(void) - purchasePendingSubscription
(void) - restoreAutorenewables
 Restores all autorenewable purchases for this user.
(void) - loadSubscription
 Loads the product inventory, the available content and the user's purchases.
(void) - enterForeground
(void) - enterBackground
(void) - subscriptionWillEnterForeground
(void) - subscriptionWillEnterBackground
(void) - subscriptionsUpdated:
(void) - userSubscriptionsUpdated:
(void) - inventoryUpdateFailedWithError:
(void) - purchaseProductFinished:
(void) - purchaseProductFailed:withError:
(void) - downloadContentFinished:
(void) - downloadContentFailed:
(void) - restoreAutorenewablesFinished:
(void) - restoreAutorenewableProductFailed:
(void) - restoreAutorenewablesFailedWithError:

Detailed Description

This class provides the primary interface for interacting with the Urban Airship subscription functionality.

It provides support for both autorenewable and non-autorenewable subscriptions.

Register a UASubscriptionManagerObserver to receive notifications when products, subsriptions or their contents change.


Member Function Documentation

- (void) loadSubscription

Loads the product inventory, the available content and the user's purchases.

This is an asynchronous task. Register a UASubscriptionManagerObserver to receive status updates for this process.

- (void) purchase: (UASubscriptionProduct *)  product

Purchase a subscription product.

Register a UASubscriptionManagerObserver to receive status updates for this process.

Parameters:
productThe subscription product to purchase
- (void) purchaseProductWithId: (NSString *)  productId

Purchase a subscription product.

Register a UASubscriptionManagerObserver to receive status updates for this process.

Parameters:
productThe product ID to purchase
- (void) restoreAutorenewables

Restores all autorenewable purchases for this user.

This triggers a StoreKit restore process, which requests receipts for all the autorenewable subscription products that this user has ever purchased.

Once received, the receipts are submitted to Urban Airship so that the appropriate access may be granted. If the user is restoring purchases from another device, this device's user will be merged into the original UA user based on their iTunes account.

Register a UASubscriptionManagerObserver to receive status updates for this process.

+ (BOOL) setDownloadDirectory: (NSString *)  path

Set a custom download directory, creating it if necessary.

Creates a product ID subdirectory if the product ID is specified in the Urban Airship content information.

The default directory is defined as kUADownloadDirectory: <library directory>="">/ua/downloads/

Parameters:
pathThe custom download directory (with trailing slash)
Returns:
YES if the path was successfully set (exists or created)
+ (BOOL) setDownloadDirectory: (NSString *)  path
withProductIDSubdir: (BOOL)  makeSubdir 

Set a custom download directory.

Optionally creates a product ID subdirectory if the product ID is specified in the Urban Airship content information.

The default directory is defined as kUADownloadDirectory: <library directory>="">/ua/downloads/

Parameters:
pathThe custom download directory (with trailing slash)
makeSubdirIf YES, creates a subdirectory named with the content key *OR* the product ID, if available
Returns:
YES if the path was successfully set (exists or created)
+ (UASubscriptionManager*) shared

Singleton initializer.

Returns:
The singleton instance.

The documentation for this class was generated from the following file:
 All Classes Functions Variables Properties