You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
in_app_purchase_storekit date format does not match in_app_purchase_platform_interface PurchaseDetails.transactionDate format #175072
from in_app_purchase_platform_interface
PurchaseDetails.transactionDate api documentation:
/// The timestamp of the transaction.
///
/// Milliseconds since epoch.
///
/// The value is `null` if [status] is not [PurchaseStatus.purchased].
final String? transactionDate;
but in case of SK2PurchaseDetails, field transactionDate contains date String like 2025-09-08 16:48:37
instead of millisecondsSinceEpoch.
Expected results
PurchaseDetails.transactionDate always return millisecondsSinceEpoch (for both GooglePlayPurchaseDetails and SK2PurchaseDetails).
Actual results
see above, sometimes holds number, somtimes String.
I think this confusion is added, because field contains String?, it should be changed to int?, this cannot happen.
Hi @jmagman@LouiseHsu it is worse than the OPs example, the returned dates are in a format 2026-05-13 PM 11:14:03 which cannot even be parsed by DateTime.parse since the formatter does not use 24H format instead using PM/AM probably based on device locale, which is not a good idea for an API.
The issue is in StoreKit2Translators.swiftextension Transaction which is using a magic hardcoded formatter dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" instead of Milliseconds since epoch.
Which is not complying with PurchaseDetails.transactionDate public API contract.
Note it is impacting both SK2Transaction.purchaseDate and SK2Transaction.expirationDate and ultimately PurchaseDetails.transactionDate
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
darshankawar commentedon Sep 9, 2025
@qeepcologne
This does seem to be a bug related to sk2.
https://pub.dev/documentation/in_app_purchase/latest/in_app_purchase/PurchaseDetails/transactionDate.html
Keeping the issue open for team's tracking.
jmagman commentedon Sep 18, 2025
Added to #157558
@LouiseHsu any idea why this is a
String?instead of anint??absar commentedon May 13, 2026
Hi @jmagman @LouiseHsu it is worse than the OPs example, the returned dates are in a format
2026-05-13 PM 11:14:03which cannot even be parsed byDateTime.parsesince the formatter does not use 24H format instead using PM/AM probably based on device locale, which is not a good idea for an API.The issue is in
StoreKit2Translators.swiftextension Transaction which is using a magic hardcoded formatterdateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"instead ofMilliseconds since epoch.Which is not complying with
PurchaseDetails.transactionDatepublic API contract.Note it is impacting both
SK2Transaction.purchaseDateandSK2Transaction.expirationDateand ultimatelyPurchaseDetails.transactionDate3 remaining items
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_…
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_… (
github-actions commentedon Aug 6, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.