This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[in_app_purchase] Define clang module for iOS #2125
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 0.2.1+5 | ||
|
|
||
| * Define clang module for iOS. | ||
|
|
||
| ## 0.2.1+4 | ||
|
|
||
| * Update and migrate iOS example project. | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -4,15 +4,16 @@ | |
|
|
||
| #import <Foundation/Foundation.h> | ||
| #import <StoreKit/StoreKit.h> | ||
| #import "FIAPReceiptManager.h" | ||
| #import "FIAPRequestHandler.h" | ||
| #import "InAppPurchasePlugin.h" | ||
|
|
||
| @import in_app_purchase; | ||
|
|
||
| NS_ASSUME_NONNULL_BEGIN | ||
| API_AVAILABLE(ios(11.2), macos(10.13.2)) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added availability. |
||
| @interface SKProductSubscriptionPeriodStub : SKProductSubscriptionPeriod | ||
| - (instancetype)initWithMap:(NSDictionary *)map; | ||
| @end | ||
|
|
||
| API_AVAILABLE(ios(11.2), macos(10.13.2)) | ||
| @interface SKProductDiscountStub : SKProductDiscount | ||
| - (instancetype)initWithMap:(NSDictionary *)map; | ||
| @end | ||
|
|
||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,14 +3,15 @@ | |
| // found in the LICENSE file. | ||
|
|
||
| #import <XCTest/XCTest.h> | ||
| #import "FIAObjectTranslator.h" | ||
| #import "Stubs.h" | ||
|
|
||
| @import in_app_purchase; | ||
|
|
||
| @interface TranslatorTest : XCTestCase | ||
|
|
||
| @property(strong, nonatomic) NSDictionary *periodMap; | ||
| @property(strong, nonatomic) NSDictionary *discountMap; | ||
| @property(strong, nonatomic) NSDictionary *productMap; | ||
| @property(strong, nonatomic) NSMutableDictionary *productMap; | ||
| @property(strong, nonatomic) NSDictionary *productResponseMap; | ||
| @property(strong, nonatomic) NSDictionary *paymentMap; | ||
| @property(strong, nonatomic) NSDictionary *transactionMap; | ||
|
|
@@ -30,16 +31,23 @@ - (void)setUp { | |
| @"subscriptionPeriod" : self.periodMap, | ||
| @"paymentMode" : @1 | ||
| }; | ||
| self.productMap = @{ | ||
|
|
||
| self.productMap = [[NSMutableDictionary alloc] initWithDictionary:@{ | ||
| @"price" : @"1", | ||
| @"priceLocale" : [FIAObjectTranslator getMapFromNSLocale:NSLocale.systemLocale], | ||
| @"productIdentifier" : @"123", | ||
| @"localizedTitle" : @"title", | ||
| @"localizedDescription" : @"des", | ||
| @"subscriptionPeriod" : self.periodMap, | ||
| @"introductoryPrice" : self.discountMap, | ||
| @"subscriptionGroupIdentifier" : @"com.group" | ||
| }; | ||
| }]; | ||
| if (@available(iOS 11.2, *)) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added availability so these tests passed with older SDKs. |
||
| self.productMap[@"subscriptionPeriod"] = self.periodMap; | ||
| self.productMap[@"introductoryPrice"] = self.discountMap; | ||
| } | ||
|
|
||
| if (@available(iOS 12.0, *)) { | ||
| self.productMap[@"subscriptionGroupIdentifier"] = @"com.group"; | ||
| } | ||
|
|
||
| self.productResponseMap = | ||
| @{@"products" : @[ self.productMap ], @"invalidProductIdentifiers" : @[]}; | ||
| self.paymentMap = @{ | ||
|
|
@@ -79,16 +87,20 @@ - (void)setUp { | |
| } | ||
|
|
||
| - (void)testSKProductSubscriptionPeriodStubToMap { | ||
| SKProductSubscriptionPeriodStub *period = | ||
| [[SKProductSubscriptionPeriodStub alloc] initWithMap:self.periodMap]; | ||
| NSDictionary *map = [FIAObjectTranslator getMapFromSKProductSubscriptionPeriod:period]; | ||
| XCTAssertEqualObjects(map, self.periodMap); | ||
| if (@available(iOS 11.2, *)) { | ||
| SKProductSubscriptionPeriodStub *period = | ||
| [[SKProductSubscriptionPeriodStub alloc] initWithMap:self.periodMap]; | ||
| NSDictionary *map = [FIAObjectTranslator getMapFromSKProductSubscriptionPeriod:period]; | ||
| XCTAssertEqualObjects(map, self.periodMap); | ||
| } | ||
| } | ||
|
|
||
| - (void)testSKProductDiscountStubToMap { | ||
| SKProductDiscountStub *discount = [[SKProductDiscountStub alloc] initWithMap:self.discountMap]; | ||
| NSDictionary *map = [FIAObjectTranslator getMapFromSKProductDiscount:discount]; | ||
| XCTAssertEqualObjects(map, self.discountMap); | ||
| if (@available(iOS 11.2, *)) { | ||
| SKProductDiscountStub *discount = [[SKProductDiscountStub alloc] initWithMap:self.discountMap]; | ||
| NSDictionary *map = [FIAObjectTranslator getMapFromSKProductDiscount:discount]; | ||
| XCTAssertEqualObjects(map, self.discountMap); | ||
| } | ||
| } | ||
|
|
||
| - (void)testProductToMap { | ||
|
|
@@ -125,9 +137,11 @@ - (void)testError { | |
| } | ||
|
|
||
| - (void)testLocaleToMap { | ||
| NSLocale *system = NSLocale.systemLocale; | ||
| NSDictionary *map = [FIAObjectTranslator getMapFromNSLocale:system]; | ||
| XCTAssertEqualObjects(map[@"currencySymbol"], system.currencySymbol); | ||
| if (@available(iOS 10.0, *)) { | ||
| NSLocale *system = NSLocale.systemLocale; | ||
| NSDictionary *map = [FIAObjectTranslator getMapFromNSLocale:system]; | ||
| XCTAssertEqualObjects(map[@"currencySymbol"], system.currencySymbol); | ||
| } | ||
| } | ||
|
|
||
| @end | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ name: in_app_purchase | |
| description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. | ||
| author: Flutter Team <[email protected]> | ||
| homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase | ||
| version: 0.2.1+4 | ||
| version: 0.2.1+5 | ||
|
|
||
|
|
||
| dependencies: | ||
|
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the different or benefit we gain with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fixes a static analyzer warning: