Commit 0ad4747
authored
feat(google): support one-time purchase discount offers (#51)
BREAKING CHANGE: `oneTimePurchaseOfferDetailsAndroid` type changed from
single object to array to support multiple discount offers.
Migration:
- Before: `product.oneTimePurchaseOfferDetailsAndroid?.formattedPrice`
- After:
`product.oneTimePurchaseOfferDetailsAndroid?.firstOrNull()?.formattedPrice`
Changes:
- Add discount-related types: DiscountDisplayInfoAndroid,
DiscountAmountAndroid,
ValidTimeWindowAndroid, LimitedQuantityInfoAndroid,
PreorderDetailsAndroid,
RentalDetailsAndroid
- Update BillingConverters to use oneTimePurchaseOfferDetailsList API
(Google Play Billing Library 7.0+)
- Add discount display support in Example app (ProductCard, Modals)
- Add discount feature documentation
- Fix verifyPurchaseWithIapkit return type usage in Example screens
Related issue: hyochan/react-native-iap#3102
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Android: Added discount support for one-time purchases
(percentage/amount), multiple offers per product, validity windows,
limited-quantity and rental metadata.
* UI: Shows original price when discounted, highlights discounted price
and displays discount badges and per-offer details.
* **Documentation**
* New comprehensive "Discounts (Android)" guide with multi-language
examples, UI patterns, and best practices.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent c05f2fe commit 0ad4747
17 files changed
Lines changed: 2126 additions & 90 deletions
File tree
- packages
- apple/Sources/Models
- docs/src/pages
- docs
- features
- updates
- google
- Example/src/main/java/dev/hyo/martie/screens
- uis
- openiap/src
- horizon/java/dev/hyo/openiap/utils
- main/java/dev/hyo/openiap
- play/java/dev/hyo/openiap/utils
- gql/src
- generated
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
327 | 347 | | |
328 | 348 | | |
329 | 349 | | |
| |||
376 | 396 | | |
377 | 397 | | |
378 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
379 | 408 | | |
380 | 409 | | |
381 | 410 | | |
| |||
408 | 437 | | |
409 | 438 | | |
410 | 439 | | |
411 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
412 | 443 | | |
413 | 444 | | |
414 | 445 | | |
415 | 446 | | |
416 | 447 | | |
417 | 448 | | |
418 | 449 | | |
| 450 | + | |
| 451 | + | |
419 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
420 | 456 | | |
421 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
422 | 469 | | |
423 | 470 | | |
424 | 471 | | |
425 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
426 | 477 | | |
427 | 478 | | |
428 | 479 | | |
| |||
451 | 502 | | |
452 | 503 | | |
453 | 504 | | |
454 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
455 | 508 | | |
456 | 509 | | |
457 | 510 | | |
| |||
609 | 662 | | |
610 | 663 | | |
611 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
612 | 675 | | |
613 | 676 | | |
614 | 677 | | |
| |||
658 | 721 | | |
659 | 722 | | |
660 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
661 | 733 | | |
662 | 734 | | |
663 | 735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
| |||
245 | 255 | | |
246 | 256 | | |
247 | 257 | | |
| 258 | + | |
248 | 259 | | |
249 | 260 | | |
250 | 261 | | |
| |||
0 commit comments