Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.20+2

* Fixes price not being displayed correctly.

## 0.3.20+1

* Prevent devices below iOS 15 or macOS 15 from enabling StoreKit2.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AppStoreProduct2Details extends ProductDetails {
id: product.id,
title: product.displayName,
description: product.description,
price: product.priceLocale.currencySymbol + product.price.toString(),
price: product.displayPrice,
rawPrice: product.price,
currencyCode: product.priceLocale.currencyCode,
currencySymbol: product.priceLocale.currencySymbol,
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.20+1
version: 0.3.20+2

environment:
sdk: ^3.3.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter_test/flutter_test.dart';
import 'package:in_app_purchase_storekit/in_app_purchase_storekit.dart';
import 'package:in_app_purchase_storekit/src/messages.g.dart';
import 'package:in_app_purchase_storekit/src/store_kit_2_wrappers/sk2_product_wrapper.dart';
import 'package:in_app_purchase_storekit/store_kit_wrappers.dart';

void main() {
Expand Down Expand Up @@ -104,4 +105,24 @@ void main() {
expect(wrapper.domain, 'domain');
expect(wrapper.userInfo, <String, Object>{});
});

test('test AppStoreProduct2Details conversion', () {
final SK2Product product = SK2Product(
id: '123',
displayName: 'name',
displayPrice: '0.99',
description: 'description',
price: 9.99,
type: SK2ProductType.consumable,
priceLocale: SK2PriceLocale(currencyCode: 'USD', currencySymbol: r'$'));

final AppStoreProduct2Details details =
AppStoreProduct2Details.fromSK2Product(product);

expect(details.sk2Product, product);
expect(details.price, product.displayPrice);
expect(details.id, product.id);
expect(details.description, product.description);
expect(details.currencySymbol, product.priceLocale.currencySymbol);
});
}