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] presentCodeRedemptionSheet #3274
Merged
fluttergithubbot
merged 25 commits into
flutter:master
from
ABausG:present-code-redemption-sheet
Mar 5, 2021
Merged
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d509a3e
Merge remote-tracking branch 'upstream/master'
22eeb98
Merge remote-tracking branch 'upstream/master'
ABausG ec8a602
Merge remote-tracking branch 'upstream/master'
ABausG 7fff7e5
Add Plugin Implementation
ABausG 3a9e84c
Adjust for Tests
ABausG 8f3682b
Add Tests
ABausG 1d02f54
Add XCTest
ABausG 9df88c6
Update CHANGELOG and pubspec
ABausG 792d091
Formatting
ABausG 43b6bbc
Merge remote-tracking branch 'upstream/master' into present-code-rede…
ABausG 86a46d8
Update Xcode
ABausG 06b1973
Merge remote-tracking branch 'parent/master'
f40e252
Merge remote-tracking branch 'parent/master'
262f341
Merge remote-tracking branch 'parent/master' into present-code-redemp…
50a74f6
Merge remote-tracking branch 'parent/master' into present-code-redemp…
193c351
Remove empty line
b3280da
Change Version to 0.4.2
ABausG b76aeab
Use respondToSelector to check for xcode version
ABausG de6f090
Add Unit Test in sk_methodchannel_apis_test.dart
ABausG cff62bb
Merge remote-tracking branch 'origin/master' into present-code-redemp…
ABausG 3b2d056
Merge remote-tracking branch 'parent/master' into present-code-redemp…
ABausG 8858147
Clean up fakeIOSPlatform.presentCodeRedemption
ABausG 4a761a0
Formatting
ABausG 535cc46
Merge remote-tracking branch 'parent/master' into present-code-redemp…
ABausG 47f9016
Remove respondsToSelector check
ABausG 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
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
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 |
---|---|---|
|
@@ -133,6 +133,15 @@ void main() { | |
expect(fakeIOSPlatform.applicationNameHasTransactionRestored, 'aUserID'); | ||
}); | ||
}); | ||
|
||
group('Code Redemption Sheet', () { | ||
test('presentCodeRedemptionSheet should not throw', () async { | ||
expect(fakeIOSPlatform.presentCodeRedemption, false); | ||
await SKPaymentQueueWrapper().presentCodeRedemptionSheet(); | ||
expect(fakeIOSPlatform.presentCodeRedemption, true); | ||
fakeIOSPlatform.presentCodeRedemption = false; | ||
}); | ||
ABausG marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}); | ||
} | ||
|
||
class FakeIOSPlatform { | ||
|
@@ -153,6 +162,9 @@ class FakeIOSPlatform { | |
List<Map<String, String>> transactionsFinished = []; | ||
String applicationNameHasTransactionRestored = ''; | ||
|
||
// present Code Redemption | ||
bool presentCodeRedemption = false; | ||
|
||
Future<dynamic> onMethodCall(MethodCall call) { | ||
switch (call.method) { | ||
// request makers | ||
|
@@ -193,6 +205,9 @@ class FakeIOSPlatform { | |
case '-[InAppPurchasePlugin restoreTransactions:result:]': | ||
applicationNameHasTransactionRestored = call.arguments; | ||
return Future<void>.sync(() {}); | ||
case '-[InAppPurchasePlugin presentCodeRedemptionSheet:result:]': | ||
presentCodeRedemption = true; | ||
return Future<void>.sync(() {}); | ||
} | ||
return Future<void>.sync(() {}); | ||
Comment on lines
+210
to
212
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. nit: @cyanglaz i wonder why all over the plugins Future<void>.sync(() {}); is used instead of Future<void>.value(); |
||
} | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.