Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[in_app_purchase_storekit] Fix type of error code returned from nativ…
…e code in `SKReceiptManager.retrieveReceiptData`
  • Loading branch information
blaugold committed Mar 5, 2024
commit f9b9c6d71778432171e12f623c4faeb991cf5829
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.12+1

* Fixes type of error code returned from native code in SKReceiptManager.retrieveReceiptData.

## 0.3.12

* Converts `refreshReceipt()`, `startObservingPaymentQueue()`, `stopObservingPaymentQueue()`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ - (NSString *)retrieveReceiptWithError:(FlutterError **)flutterError {
if (!receipt || receiptError) {
if (flutterError) {
NSDictionary *errorMap = [FIAObjectTranslator getMapFromNSError:receiptError];
*flutterError = [FlutterError errorWithCode:errorMap[@"code"]
message:errorMap[@"domain"]
details:errorMap[@"userInfo"]];
*flutterError =
[FlutterError errorWithCode:[NSString stringWithFormat:@"%@", errorMap[@"code"]]
message:errorMap[@"domain"]
details:errorMap[@"userInfo"]];
}
return nil;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ - (void)testRetrieveReceiptDataError {

XCTAssertNil(result);
XCTAssertNotNil(error);
XCTAssert([error.code isKindOfClass:[NSString class]]);
NSDictionary *details = error.details;
XCTAssertNotNil(details[@"error"]);
NSNumber *errorCode = (NSNumber *)details[@"error"][@"code"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase_storekit
description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.3.12
version: 0.3.12+1

environment:
sdk: ^3.2.3
Expand Down