Commit e6a7a4d
authored
fix(google): handle DEFERRED replacement mode correctly (#25)
When using DEFERRED mode (6), Google Billing returns OK status but null
purchases list since the change is scheduled for future renewal. Updated
to treat this as success instead of error.
Also updated to only set replacementMode when explicitly provided,
allowing Google Play Console defaults to be used.
Closes: hyochan/expo-iap#246
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved Android purchase flow: DEFERRED downgrades now yield a clear
empty purchase result, purchase callbacks are guarded for null results,
refresh-on-purchase is protected against errors, and purchase-handling
logs are clearer.
* **Documentation**
* Updated subscription docs and UI text to use numeric Android
replacement mode values (e.g., 1, 6), explain DEFERRED behavior with a
warning and troubleshooting guidance, and align best-practice examples.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 77c67cb commit e6a7a4d
5 files changed
Lines changed: 139 additions & 51 deletions
File tree
- packages
- docs/src/pages/docs
- google
- Example/src/main/java/dev/hyo/martie/screens
- openiap
- src
- horizon/java/dev/hyo/openiap
- play/java/dev/hyo/openiap
Lines changed: 65 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
| 615 | + | |
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
620 | | - | |
| 619 | + | |
| 620 | + | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
624 | | - | |
| 623 | + | |
| 624 | + | |
625 | 625 | | |
626 | 626 | | |
627 | | - | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
628 | 631 | | |
629 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
630 | 638 | | |
631 | 639 | | |
632 | 640 | | |
| |||
694 | 702 | | |
695 | 703 | | |
696 | 704 | | |
697 | | - | |
| 705 | + | |
698 | 706 | | |
699 | 707 | | |
700 | 708 | | |
| |||
714 | 722 | | |
715 | 723 | | |
716 | 724 | | |
717 | | - | |
| 725 | + | |
718 | 726 | | |
719 | 727 | | |
720 | 728 | | |
| |||
726 | 734 | | |
727 | 735 | | |
728 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
729 | 771 | | |
730 | 772 | | |
731 | 773 | | |
| |||
741 | 783 | | |
742 | 784 | | |
743 | 785 | | |
744 | | - | |
| 786 | + | |
745 | 787 | | |
746 | 788 | | |
747 | 789 | | |
| 790 | + | |
748 | 791 | | |
749 | 792 | | |
750 | 793 | | |
| |||
820 | 863 | | |
821 | 864 | | |
822 | 865 | | |
823 | | - | |
824 | | - | |
825 | | - | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
826 | 869 | | |
827 | 870 | | |
828 | | - | |
| 871 | + | |
829 | 872 | | |
830 | 873 | | |
831 | 874 | | |
832 | | - | |
| 875 | + | |
833 | 876 | | |
834 | 877 | | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
835 | 882 | | |
836 | 883 | | |
837 | | - | |
| 884 | + | |
838 | 885 | | |
839 | 886 | | |
840 | 887 | | |
| |||
868 | 915 | | |
869 | 916 | | |
870 | 917 | | |
871 | | - | |
872 | | - | |
| 918 | + | |
| 919 | + | |
873 | 920 | | |
874 | 921 | | |
875 | 922 | | |
876 | 923 | | |
877 | 924 | | |
878 | | - | |
| 925 | + | |
879 | 926 | | |
880 | 927 | | |
881 | 928 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| |||
Lines changed: 27 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
725 | | - | |
726 | | - | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
727 | 730 | | |
728 | | - | |
| 731 | + | |
729 | 732 | | |
730 | 733 | | |
731 | 734 | | |
| |||
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
744 | | - | |
745 | | - | |
| 747 | + | |
746 | 748 | | |
747 | 749 | | |
748 | | - | |
| 750 | + | |
749 | 751 | | |
750 | 752 | | |
751 | 753 | | |
752 | | - | |
753 | | - | |
| 754 | + | |
754 | 755 | | |
755 | 756 | | |
756 | 757 | | |
757 | 758 | | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
| 759 | + | |
| 760 | + | |
762 | 761 | | |
763 | 762 | | |
764 | | - | |
765 | 763 | | |
766 | | - | |
767 | 764 | | |
768 | 765 | | |
769 | | - | |
770 | 766 | | |
771 | 767 | | |
772 | 768 | | |
773 | 769 | | |
774 | 770 | | |
775 | | - | |
776 | | - | |
777 | | - | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
778 | 786 | | |
779 | 787 | | |
780 | 788 | | |
| |||
Lines changed: 29 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
861 | 870 | | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
862 | 882 | | |
863 | | - | |
864 | 883 | | |
865 | 884 | | |
866 | 885 | | |
| |||
0 commit comments