-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from hansemannn/MOD-2375
Add iOS 11.2 API's, support product discount
- Loading branch information
Showing
13 changed files
with
200 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2017 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
#import "TiProxy.h" | ||
#import <StoreKit/StoreKit.h> | ||
|
||
#if IS_IOS_11_2 | ||
|
||
@interface TiStorekitProductDiscountProxy : TiProxy { | ||
SKProductDiscount *_productDiscount; | ||
} | ||
|
||
- (id)initWithProductDiscount:(SKProductDiscount *)productDiscount pageContext:(id<TiEvaluator>)context; | ||
|
||
- (NSNumber *)price; | ||
|
||
- (NSString *)priceLocale; | ||
|
||
- (NSDictionary *)subscriptionPeriod; | ||
|
||
- (NSNumber *)numberOfPeriods; | ||
|
||
- (NSNumber *)paymentMode; | ||
|
||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2017 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
#import "TiStorekitProductDiscountProxy.h" | ||
|
||
@implementation TiStorekitProductDiscountProxy | ||
|
||
- (id)initWithProductDiscount:(SKProductDiscount *)productDiscount pageContext:(id<TiEvaluator>)context | ||
{ | ||
if (self = [super _initWithPageContext:context]) { | ||
_productDiscount = productDiscount; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (NSNumber *)price | ||
{ | ||
return _productDiscount.price; | ||
} | ||
|
||
- (NSString *)priceLocale | ||
{ | ||
return _productDiscount.priceLocale.localeIdentifier; | ||
} | ||
|
||
- (NSDictionary *)subscriptionPeriod | ||
{ | ||
return @{ | ||
@"numberOfUnits": @(_productDiscount.subscriptionPeriod.numberOfUnits), | ||
@"unit": @(_productDiscount.subscriptionPeriod.unit), | ||
}; | ||
} | ||
|
||
- (NSNumber *)numberOfPeriods | ||
{ | ||
return @(_productDiscount.numberOfPeriods); | ||
} | ||
|
||
- (NSNumber *)paymentMode | ||
{ | ||
return @(_productDiscount.paymentMode); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters