Commit d151b54
committed
[in_app_purchase] Fixes StoreKit 2 date format does not match in_app_purchase_platform_interface
- As per `PurchaseDetails.transactionDate` api documentation, date should be `Milliseconds since epoch` but the migration to StoreKit2 probably mistakenly changed the date format to "yyyy-MM-dd HH:mm:ss". The issue originated in StoreKit2Translators.swift `extension Transaction convertToPigeon` which was using a magic hardcoded formatter dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
- Fixes both `SK2Transaction.purchaseDate` and `SK2Transaction.expirationDate` and ultimately `PurchaseDetails.transactionDate`
Unfortunately it is not testable because the StoreKit 2 Transaction type has no visible initializers, probably thats why there are no tests for StoreKit2Translators.swift `extension Transaction convertToPigeon`
Fixes flutter/flutter#1750721 parent 6246800 commit d151b54
3 files changed
Lines changed: 8 additions & 7 deletions
File tree
- packages/in_app_purchase/in_app_purchase_storekit
- darwin/in_app_purchase_storekit/Sources/in_app_purchase_storekit/StoreKit2
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
1 | 6 | | |
2 | 7 | | |
3 | 8 | | |
| |||
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 197 | | |
202 | 198 | | |
203 | 199 | | |
204 | 200 | | |
205 | | - | |
206 | | - | |
| 201 | + | |
| 202 | + | |
207 | 203 | | |
208 | 204 | | |
209 | 205 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments