![]() |
Ignite Tools
|
00001 /* 00002 Copyright 2009-2011 Urban Airship Inc. All rights reserved. 00003 00004 Redistribution and use in source and binary forms, with or without 00005 modification, are permitted provided that the following conditions are met: 00006 00007 1. Redistributions of source code must retain the above copyright notice, this 00008 list of conditions and the following disclaimer. 00009 00010 2. Redistributions in binaryform must reproduce the above copyright notice, 00011 this list of conditions and the following disclaimer in the documentation 00012 and/or other materials provided withthe distribution. 00013 00014 THIS SOFTWARE IS PROVIDED BY THE URBAN AIRSHIP INC``AS IS'' AND ANY EXPRESS OR 00015 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00016 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 00017 EVENT SHALL URBAN AIRSHIP INC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 00018 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00019 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00020 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00021 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 00022 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00023 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 */ 00025 00026 #import <Foundation/Foundation.h> 00027 00028 @class SKProduct; 00029 00030 typedef enum _UAAutorenewableDuration { 00031 UAAutorenewableDurationNone = 0, 00032 UAAutorenewableDuration7Days = 1, 00033 UAAutorenewableDuration1Month = 2, 00034 UAAutorenewableDuration2Months = 3, 00035 UAAutorenewableDuration3Months = 4, 00036 UAAutorenewableDuration6Months = 5, 00037 UAAutorenewableDuration1Year = 6 00038 } UAAutorenewableDuration; 00039 00040 @interface UASubscriptionProduct : NSObject { 00041 @private 00042 NSString *productIdentifier; 00043 NSString *subscriptionKey; 00044 NSString *subscriptionName; 00045 NSURL *subscribeURL; 00046 NSURL *previewURL; 00047 NSURL *iconURL; 00048 int duration; 00049 00050 BOOL autorenewable; 00051 UAAutorenewableDuration autorenewableDuration; 00052 00053 //property from SKProduct 00054 SKProduct *skProduct; 00055 NSString *title; 00056 NSString *productDescription; 00057 NSString *price; 00058 NSDecimalNumber *priceNumber; 00059 00060 // For purchased product 00061 BOOL purchased; 00062 NSDate *startDate; 00063 NSDate *endDate; 00064 00065 // Flag to indicate if the product is in the app store 00066 BOOL isForSale; 00067 00068 // For UI 00069 BOOL isPurchasing; 00070 } 00071 00075 00076 @property (nonatomic, retain) NSString *productIdentifier; 00077 @property (nonatomic, retain) NSURL *subscribeURL; 00078 @property (nonatomic, retain) NSURL *previewURL; 00079 @property (nonatomic, retain) NSURL *iconURL; 00080 00088 @property (nonatomic, assign) int duration; 00089 @property (nonatomic, retain) NSString *subscriptionKey; 00090 @property (nonatomic, retain) NSString *subscriptionName; 00091 00093 @property (nonatomic, retain) SKProduct *skProduct; 00094 @property (nonatomic, retain) NSString *title; 00095 @property (nonatomic, retain) NSString *productDescription; 00096 @property (nonatomic, retain) NSString *price; 00097 @property (nonatomic, retain) NSDecimalNumber *priceNumber; 00098 00099 @property (nonatomic, assign) BOOL isPurchasing; 00100 00104 00106 @property (nonatomic, assign) BOOL purchased; 00107 00113 @property (nonatomic, retain) NSDate *startDate; 00114 00120 @property (nonatomic, retain) NSDate *endDate; 00121 00123 @property (nonatomic, assign) BOOL isForSale; 00124 00128 00130 @property(nonatomic, assign, getter=isAutorenewable) BOOL autorenewable; 00131 00133 @property(nonatomic, assign) UAAutorenewableDuration autorenewableDuration; 00134 00135 - (id)initWithDict:(NSDictionary *)dict; 00136 - (id)initWithSubscriptionProduct:(UASubscriptionProduct *)sp; 00137 - (void)setPurchasingInfo:(NSDictionary *)purchasingInfo; 00138 00139 @end