expo-iap 3.1.36 → 3.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/expo/modules/iap/ExpoIapModule.kt +58 -3
- package/build/index.d.ts +38 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +48 -0
- package/build/index.js.map +1 -1
- package/build/modules/android.d.ts +4 -2
- package/build/modules/android.d.ts.map +1 -1
- package/build/modules/android.js +2 -0
- package/build/modules/android.js.map +1 -1
- package/build/modules/ios.d.ts.map +1 -1
- package/build/modules/ios.js +2 -1
- package/build/modules/ios.js.map +1 -1
- package/build/types.d.ts +109 -51
- package/build/types.d.ts.map +1 -1
- package/build/types.js +3 -0
- package/build/types.js.map +1 -1
- package/build/useIAP.d.ts +5 -2
- package/build/useIAP.d.ts.map +1 -1
- package/build/useIAP.js +9 -1
- package/build/useIAP.js.map +1 -1
- package/build/utils/errorMapping.d.ts.map +1 -1
- package/build/utils/errorMapping.js +3 -0
- package/build/utils/errorMapping.js.map +1 -1
- package/coverage/clover.xml +185 -176
- package/coverage/coverage-final.json +4 -4
- package/coverage/lcov-report/index.html +18 -18
- package/coverage/lcov-report/src/index.html +18 -18
- package/coverage/lcov-report/src/index.ts.html +178 -10
- package/coverage/lcov-report/src/modules/android.ts.html +10 -4
- package/coverage/lcov-report/src/modules/index.html +1 -1
- package/coverage/lcov-report/src/modules/ios.ts.html +10 -13
- package/coverage/lcov-report/src/utils/debug.ts.html +1 -1
- package/coverage/lcov-report/src/utils/errorMapping.ts.html +18 -3
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov.info +338 -319
- package/ios/ExpoIap.podspec +1 -2
- package/ios/ExpoIapModule.swift +48 -8
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/src/index.ts +56 -0
- package/src/modules/android.ts +4 -2
- package/src/modules/ios.ts +7 -8
- package/src/types.ts +126 -57
- package/src/useIAP.ts +27 -5
- package/src/utils/errorMapping.ts +5 -0
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">94.11% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>464/493</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">86.
|
|
33
|
+
<span class="strong">86.77% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>223/257</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">79.38% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>77/97</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">93.
|
|
47
|
+
<span class="strong">93.99% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>438/466</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
82
|
<td class="file high" data-value="src"><a href="src/index.html">src</a></td>
|
|
83
|
-
<td data-value="96.
|
|
83
|
+
<td data-value="96.83" class="pic high">
|
|
84
84
|
<div class="chart"><div class="cover-fill" style="width: 96%"></div><div class="cover-empty" style="width: 4%"></div></div>
|
|
85
85
|
</td>
|
|
86
|
-
<td data-value="96.
|
|
87
|
-
<td data-value="
|
|
88
|
-
<td data-value="
|
|
89
|
-
<td data-value="
|
|
90
|
-
<td data-value="
|
|
91
|
-
<td data-value="
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
86
|
+
<td data-value="96.83" class="pct high">96.83%</td>
|
|
87
|
+
<td data-value="221" class="abs high">214/221</td>
|
|
88
|
+
<td data-value="90.47" class="pct high">90.47%</td>
|
|
89
|
+
<td data-value="105" class="abs high">95/105</td>
|
|
90
|
+
<td data-value="79.06" class="pct medium">79.06%</td>
|
|
91
|
+
<td data-value="43" class="abs medium">34/43</td>
|
|
92
|
+
<td data-value="97.07" class="pct high">97.07%</td>
|
|
93
|
+
<td data-value="205" class="abs high">199/205</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
<tr>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at 2025-
|
|
134
|
+
at 2025-12-07T08:40:10.740Z
|
|
135
135
|
</div>
|
|
136
136
|
<script src="prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">96.
|
|
26
|
+
<span class="strong">96.83% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>214/221</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">90.47% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>95/105</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">79.06% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>34/43</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">97.07% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>199/205</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
82
|
<td class="file high" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
|
|
83
|
-
<td data-value="96.
|
|
83
|
+
<td data-value="96.83" class="pic high">
|
|
84
84
|
<div class="chart"><div class="cover-fill" style="width: 96%"></div><div class="cover-empty" style="width: 4%"></div></div>
|
|
85
85
|
</td>
|
|
86
|
-
<td data-value="96.
|
|
87
|
-
<td data-value="
|
|
88
|
-
<td data-value="
|
|
89
|
-
<td data-value="
|
|
90
|
-
<td data-value="
|
|
91
|
-
<td data-value="
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
86
|
+
<td data-value="96.83" class="pct high">96.83%</td>
|
|
87
|
+
<td data-value="221" class="abs high">214/221</td>
|
|
88
|
+
<td data-value="90.47" class="pct high">90.47%</td>
|
|
89
|
+
<td data-value="105" class="abs high">95/105</td>
|
|
90
|
+
<td data-value="79.06" class="pct medium">79.06%</td>
|
|
91
|
+
<td data-value="43" class="abs medium">34/43</td>
|
|
92
|
+
<td data-value="97.07" class="pct high">97.07%</td>
|
|
93
|
+
<td data-value="205" class="abs high">199/205</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
</tbody>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2025-
|
|
104
|
+
at 2025-12-07T08:40:10.740Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">96.
|
|
26
|
+
<span class="strong">96.83% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>214/221</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">90.47% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>95/105</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">79.06% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>34/43</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">97.07% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>199/205</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -818,7 +818,63 @@
|
|
|
818
818
|
<a name='L753'></a><a href='#L753'>753</a>
|
|
819
819
|
<a name='L754'></a><a href='#L754'>754</a>
|
|
820
820
|
<a name='L755'></a><a href='#L755'>755</a>
|
|
821
|
-
<a name='L756'></a><a href='#L756'>756</a
|
|
821
|
+
<a name='L756'></a><a href='#L756'>756</a>
|
|
822
|
+
<a name='L757'></a><a href='#L757'>757</a>
|
|
823
|
+
<a name='L758'></a><a href='#L758'>758</a>
|
|
824
|
+
<a name='L759'></a><a href='#L759'>759</a>
|
|
825
|
+
<a name='L760'></a><a href='#L760'>760</a>
|
|
826
|
+
<a name='L761'></a><a href='#L761'>761</a>
|
|
827
|
+
<a name='L762'></a><a href='#L762'>762</a>
|
|
828
|
+
<a name='L763'></a><a href='#L763'>763</a>
|
|
829
|
+
<a name='L764'></a><a href='#L764'>764</a>
|
|
830
|
+
<a name='L765'></a><a href='#L765'>765</a>
|
|
831
|
+
<a name='L766'></a><a href='#L766'>766</a>
|
|
832
|
+
<a name='L767'></a><a href='#L767'>767</a>
|
|
833
|
+
<a name='L768'></a><a href='#L768'>768</a>
|
|
834
|
+
<a name='L769'></a><a href='#L769'>769</a>
|
|
835
|
+
<a name='L770'></a><a href='#L770'>770</a>
|
|
836
|
+
<a name='L771'></a><a href='#L771'>771</a>
|
|
837
|
+
<a name='L772'></a><a href='#L772'>772</a>
|
|
838
|
+
<a name='L773'></a><a href='#L773'>773</a>
|
|
839
|
+
<a name='L774'></a><a href='#L774'>774</a>
|
|
840
|
+
<a name='L775'></a><a href='#L775'>775</a>
|
|
841
|
+
<a name='L776'></a><a href='#L776'>776</a>
|
|
842
|
+
<a name='L777'></a><a href='#L777'>777</a>
|
|
843
|
+
<a name='L778'></a><a href='#L778'>778</a>
|
|
844
|
+
<a name='L779'></a><a href='#L779'>779</a>
|
|
845
|
+
<a name='L780'></a><a href='#L780'>780</a>
|
|
846
|
+
<a name='L781'></a><a href='#L781'>781</a>
|
|
847
|
+
<a name='L782'></a><a href='#L782'>782</a>
|
|
848
|
+
<a name='L783'></a><a href='#L783'>783</a>
|
|
849
|
+
<a name='L784'></a><a href='#L784'>784</a>
|
|
850
|
+
<a name='L785'></a><a href='#L785'>785</a>
|
|
851
|
+
<a name='L786'></a><a href='#L786'>786</a>
|
|
852
|
+
<a name='L787'></a><a href='#L787'>787</a>
|
|
853
|
+
<a name='L788'></a><a href='#L788'>788</a>
|
|
854
|
+
<a name='L789'></a><a href='#L789'>789</a>
|
|
855
|
+
<a name='L790'></a><a href='#L790'>790</a>
|
|
856
|
+
<a name='L791'></a><a href='#L791'>791</a>
|
|
857
|
+
<a name='L792'></a><a href='#L792'>792</a>
|
|
858
|
+
<a name='L793'></a><a href='#L793'>793</a>
|
|
859
|
+
<a name='L794'></a><a href='#L794'>794</a>
|
|
860
|
+
<a name='L795'></a><a href='#L795'>795</a>
|
|
861
|
+
<a name='L796'></a><a href='#L796'>796</a>
|
|
862
|
+
<a name='L797'></a><a href='#L797'>797</a>
|
|
863
|
+
<a name='L798'></a><a href='#L798'>798</a>
|
|
864
|
+
<a name='L799'></a><a href='#L799'>799</a>
|
|
865
|
+
<a name='L800'></a><a href='#L800'>800</a>
|
|
866
|
+
<a name='L801'></a><a href='#L801'>801</a>
|
|
867
|
+
<a name='L802'></a><a href='#L802'>802</a>
|
|
868
|
+
<a name='L803'></a><a href='#L803'>803</a>
|
|
869
|
+
<a name='L804'></a><a href='#L804'>804</a>
|
|
870
|
+
<a name='L805'></a><a href='#L805'>805</a>
|
|
871
|
+
<a name='L806'></a><a href='#L806'>806</a>
|
|
872
|
+
<a name='L807'></a><a href='#L807'>807</a>
|
|
873
|
+
<a name='L808'></a><a href='#L808'>808</a>
|
|
874
|
+
<a name='L809'></a><a href='#L809'>809</a>
|
|
875
|
+
<a name='L810'></a><a href='#L810'>810</a>
|
|
876
|
+
<a name='L811'></a><a href='#L811'>811</a>
|
|
877
|
+
<a name='L812'></a><a href='#L812'>812</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
822
878
|
<span class="cline-any cline-yes">2x</span>
|
|
823
879
|
<span class="cline-any cline-yes">2x</span>
|
|
824
880
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1529,6 +1585,8 @@
|
|
|
1529
1585
|
<span class="cline-any cline-neutral"> </span>
|
|
1530
1586
|
<span class="cline-any cline-neutral"> </span>
|
|
1531
1587
|
<span class="cline-any cline-neutral"> </span>
|
|
1588
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1589
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1532
1590
|
<span class="cline-any cline-yes">2x</span>
|
|
1533
1591
|
<span class="cline-any cline-neutral"> </span>
|
|
1534
1592
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1561,6 +1619,60 @@
|
|
|
1561
1619
|
<span class="cline-any cline-yes">1x</span>
|
|
1562
1620
|
<span class="cline-any cline-neutral"> </span>
|
|
1563
1621
|
<span class="cline-any cline-neutral"> </span>
|
|
1622
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1623
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1624
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1625
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1626
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1627
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1628
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1629
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1630
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1631
|
+
<span class="cline-any cline-yes">2x</span>
|
|
1632
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1633
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1634
|
+
<span class="cline-any cline-yes">3x</span>
|
|
1635
|
+
<span class="cline-any cline-yes">2x</span>
|
|
1636
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1637
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1638
|
+
<span class="cline-any cline-yes">1x</span>
|
|
1639
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1640
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1641
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1642
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1643
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1644
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1645
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1646
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1647
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1648
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1649
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1650
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1651
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1652
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1653
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1654
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1655
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1656
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1657
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1658
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1659
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1660
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1661
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1662
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1663
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1664
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1665
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1666
|
+
<span class="cline-any cline-yes">2x</span>
|
|
1667
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1668
|
+
<span class="cline-any cline-yes">2x</span>
|
|
1669
|
+
<span class="cline-any cline-yes">13x</span>
|
|
1670
|
+
<span class="cline-any cline-yes">12x</span>
|
|
1671
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1672
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1673
|
+
<span class="cline-any cline-yes">1x</span>
|
|
1674
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1675
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1564
1676
|
<span class="cline-any cline-yes">2x</span>
|
|
1565
1677
|
<span class="cline-any cline-yes">2x</span>
|
|
1566
1678
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -2283,6 +2395,8 @@ export const deepLinkToSubscriptions: MutationField<
|
|
|
2283
2395
|
* For production apps, always validate receipts on your secure server:
|
|
2284
2396
|
* - iOS: Send receipt data to Apple's verification endpoint from your server
|
|
2285
2397
|
* - Android: Use Google Play Developer API with service account credentials
|
|
2398
|
+
*
|
|
2399
|
+
* @deprecated Use verifyPurchase instead
|
|
2286
2400
|
*/
|
|
2287
2401
|
export const validateReceipt: MutationField<'validateReceipt'> = async (
|
|
2288
2402
|
options,
|
|
@@ -2316,6 +2430,60 @@ export const validateReceipt: MutationField<'validateReceipt'> = async (
|
|
|
2316
2430
|
throw new Error('Platform not supported');
|
|
2317
2431
|
};
|
|
2318
2432
|
|
|
2433
|
+
/**
|
|
2434
|
+
* Verify purchase with the configured providers
|
|
2435
|
+
*
|
|
2436
|
+
* This function uses the native OpenIAP verifyPurchase implementation
|
|
2437
|
+
* which validates purchases using platform-specific methods.
|
|
2438
|
+
*
|
|
2439
|
+
* @param options - Receipt validation options containing the SKU
|
|
2440
|
+
* @returns Promise resolving to receipt validation result
|
|
2441
|
+
*/
|
|
2442
|
+
export const verifyPurchase: MutationField<'verifyPurchase'> = async (
|
|
2443
|
+
options,
|
|
2444
|
+
) => {
|
|
2445
|
+
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
2446
|
+
return ExpoIapModule.verifyPurchase(options);
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
throw new Error(`Unsupported platform: ${Platform.OS}`);
|
|
2450
|
+
};
|
|
2451
|
+
|
|
2452
|
+
/**
|
|
2453
|
+
* Verify purchase with a specific provider (e.g., IAPKit)
|
|
2454
|
+
*
|
|
2455
|
+
* This function allows you to verify purchases using external verification
|
|
2456
|
+
* services like IAPKit, which provide additional validation and security.
|
|
2457
|
+
*
|
|
2458
|
+
* @param options - Verification options including provider and credentials
|
|
2459
|
+
* @returns Promise resolving to provider-specific verification result
|
|
2460
|
+
*
|
|
2461
|
+
* @example
|
|
2462
|
+
* ```typescript
|
|
2463
|
+
* const result = await verifyPurchaseWithProvider({
|
|
2464
|
+
* provider: 'iapkit',
|
|
2465
|
+
* iapkit: {
|
|
2466
|
+
* apiKey: 'your-api-key',
|
|
2467
|
+
* apple: {
|
|
2468
|
+
* jws: purchase.purchaseToken // JWS from purchase
|
|
2469
|
+
* },
|
|
2470
|
+
* google: {
|
|
2471
|
+
* purchaseToken: purchase.purchaseToken
|
|
2472
|
+
* }
|
|
2473
|
+
* }
|
|
2474
|
+
* });
|
|
2475
|
+
* ```
|
|
2476
|
+
*/
|
|
2477
|
+
export const verifyPurchaseWithProvider: MutationField<
|
|
2478
|
+
'verifyPurchaseWithProvider'
|
|
2479
|
+
> = async (options) => {
|
|
2480
|
+
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
2481
|
+
return ExpoIapModule.verifyPurchaseWithProvider(options);
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
throw new Error(`Unsupported platform: ${Platform.OS}`);
|
|
2485
|
+
};
|
|
2486
|
+
|
|
2319
2487
|
export * from './useIAP';
|
|
2320
2488
|
export {
|
|
2321
2489
|
<span class="fstat-no" title="function not covered" > ErrorCodeUtils,</span>
|
|
@@ -2335,7 +2503,7 @@ export {<span class="fstat-no" title="function not covered" >ExpoIapConsole}</sp
|
|
|
2335
2503
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
2336
2504
|
Code coverage generated by
|
|
2337
2505
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
2338
|
-
at 2025-
|
|
2506
|
+
at 2025-12-07T08:40:10.740Z
|
|
2339
2507
|
</div>
|
|
2340
2508
|
<script src="../prettify.js"></script>
|
|
2341
2509
|
<script>
|
|
@@ -311,7 +311,9 @@
|
|
|
311
311
|
<a name='L246'></a><a href='#L246'>246</a>
|
|
312
312
|
<a name='L247'></a><a href='#L247'>247</a>
|
|
313
313
|
<a name='L248'></a><a href='#L248'>248</a>
|
|
314
|
-
<a name='L249'></a><a href='#L249'>249</a
|
|
314
|
+
<a name='L249'></a><a href='#L249'>249</a>
|
|
315
|
+
<a name='L250'></a><a href='#L250'>250</a>
|
|
316
|
+
<a name='L251'></a><a href='#L251'>251</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
315
317
|
<span class="cline-any cline-yes">3x</span>
|
|
316
318
|
<span class="cline-any cline-neutral"> </span>
|
|
317
319
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -401,6 +403,8 @@
|
|
|
401
403
|
<span class="cline-any cline-neutral"> </span>
|
|
402
404
|
<span class="cline-any cline-neutral"> </span>
|
|
403
405
|
<span class="cline-any cline-neutral"> </span>
|
|
406
|
+
<span class="cline-any cline-neutral"> </span>
|
|
407
|
+
<span class="cline-any cline-neutral"> </span>
|
|
404
408
|
<span class="cline-any cline-yes">3x</span>
|
|
405
409
|
<span class="cline-any cline-neutral"> </span>
|
|
406
410
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -569,7 +573,7 @@ import ExpoIapModule from '../ExpoIapModule';
|
|
|
569
573
|
import type {
|
|
570
574
|
DeepLinkOptions,
|
|
571
575
|
MutationField,
|
|
572
|
-
|
|
576
|
+
VerifyPurchaseResultAndroid,
|
|
573
577
|
} from '../types';
|
|
574
578
|
|
|
575
579
|
type NativeAndroidModule = {
|
|
@@ -641,6 +645,8 @@ export const deepLinkToSubscriptionsAndroid = async (
|
|
|
641
645
|
* Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including
|
|
642
646
|
* your access token in the binary you ship to users is potentially dangerous.
|
|
643
647
|
* Use server side validation instead for your production builds
|
|
648
|
+
*
|
|
649
|
+
* @deprecated Use verifyPurchase instead
|
|
644
650
|
* @param {Object} params - The parameters object
|
|
645
651
|
* @param {string} params.packageName - package name of your app.
|
|
646
652
|
* @param {string} params.productId - product id for your in app product.
|
|
@@ -661,7 +667,7 @@ export const validateReceiptAndroid = async ({
|
|
|
661
667
|
productToken: string;
|
|
662
668
|
accessToken: string;
|
|
663
669
|
isSub?: boolean;
|
|
664
|
-
}): Promise<
|
|
670
|
+
}): Promise<VerifyPurchaseResultAndroid> => {
|
|
665
671
|
const type = isSub ? 'subscriptions' : 'products';
|
|
666
672
|
|
|
667
673
|
const url =
|
|
@@ -814,7 +820,7 @@ export const createAlternativeBillingTokenAndroid: MutationField<
|
|
|
814
820
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
815
821
|
Code coverage generated by
|
|
816
822
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
817
|
-
at 2025-
|
|
823
|
+
at 2025-12-07T08:40:10.740Z
|
|
818
824
|
</div>
|
|
819
825
|
<script src="../../prettify.js"></script>
|
|
820
826
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2025-
|
|
119
|
+
at 2025-12-07T08:40:10.740Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -461,8 +461,7 @@
|
|
|
461
461
|
<a name='L396'></a><a href='#L396'>396</a>
|
|
462
462
|
<a name='L397'></a><a href='#L397'>397</a>
|
|
463
463
|
<a name='L398'></a><a href='#L398'>398</a>
|
|
464
|
-
<a name='L399'></a><a href='#L399'>399</a>
|
|
465
|
-
<a name='L400'></a><a href='#L400'>400</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
464
|
+
<a name='L399'></a><a href='#L399'>399</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
466
465
|
<span class="cline-any cline-neutral"> </span>
|
|
467
466
|
<span class="cline-any cline-neutral"> </span>
|
|
468
467
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -698,9 +697,8 @@
|
|
|
698
697
|
<span class="cline-any cline-neutral"> </span>
|
|
699
698
|
<span class="cline-any cline-neutral"> </span>
|
|
700
699
|
<span class="cline-any cline-neutral"> </span>
|
|
701
|
-
<span class="cline-any cline-yes">3x</span>
|
|
702
|
-
<span class="cline-any cline-neutral"> </span>
|
|
703
700
|
<span class="cline-any cline-neutral"> </span>
|
|
701
|
+
<span class="cline-any cline-yes">3x</span>
|
|
704
702
|
<span class="cline-any cline-neutral"> </span>
|
|
705
703
|
<span class="cline-any cline-yes">4x</span>
|
|
706
704
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -876,8 +874,8 @@ import type {
|
|
|
876
874
|
Purchase,
|
|
877
875
|
PurchaseIOS,
|
|
878
876
|
QueryField,
|
|
879
|
-
|
|
880
|
-
|
|
877
|
+
VerifyPurchaseProps,
|
|
878
|
+
VerifyPurchaseResultIOS,
|
|
881
879
|
SubscriptionStatusIOS,
|
|
882
880
|
} from '../types';
|
|
883
881
|
import type {PurchaseError} from '../utils/errorMapping';
|
|
@@ -1089,7 +1087,8 @@ export const getTransactionJwsIOS: QueryField<'getTransactionJwsIOS'> = as
|
|
|
1089
1087
|
* NOTE: For proper security, Apple recommends verifying receipts on your server using
|
|
1090
1088
|
* the verifyReceipt endpoint rather than relying solely on client-side verification.
|
|
1091
1089
|
*
|
|
1092
|
-
* @
|
|
1090
|
+
* @deprecated Use verifyPurchase instead
|
|
1091
|
+
* @param props The product's SKU or verification props
|
|
1093
1092
|
* @returns {Promise<{
|
|
1094
1093
|
* isValid: boolean;
|
|
1095
1094
|
* receiptData: string;
|
|
@@ -1097,11 +1096,9 @@ export const getTransactionJwsIOS: QueryField<'getTransactionJwsIOS'> = as
|
|
|
1097
1096
|
* latestTransaction?: Purchase;
|
|
1098
1097
|
* }>}
|
|
1099
1098
|
*/
|
|
1100
|
-
const validateReceiptIOSImpl = async (
|
|
1101
|
-
props: ReceiptValidationProps | string,
|
|
1102
|
-
) => {
|
|
1099
|
+
const validateReceiptIOSImpl = async (props: VerifyPurchaseProps | string) => {
|
|
1103
1100
|
const sku =
|
|
1104
|
-
typeof props === 'string' ? props : (props as
|
|
1101
|
+
typeof props === 'string' ? props : (props as VerifyPurchaseProps)?.sku;
|
|
1105
1102
|
|
|
1106
1103
|
if (!sku) {
|
|
1107
1104
|
throw new Error('validateReceiptIOS requires a SKU');
|
|
@@ -1109,7 +1106,7 @@ const validateReceiptIOSImpl = async (
|
|
|
1109
1106
|
|
|
1110
1107
|
return (await ExpoIapModule.validateReceiptIOS(
|
|
1111
1108
|
sku,
|
|
1112
|
-
)) as
|
|
1109
|
+
)) as VerifyPurchaseResultIOS;
|
|
1113
1110
|
};
|
|
1114
1111
|
|
|
1115
1112
|
export const validateReceiptIOS =
|
|
@@ -1267,7 +1264,7 @@ export const presentExternalPurchaseLinkIOS: MutationField<
|
|
|
1267
1264
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1268
1265
|
Code coverage generated by
|
|
1269
1266
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1270
|
-
at 2025-
|
|
1267
|
+
at 2025-12-07T08:40:10.740Z
|
|
1271
1268
|
</div>
|
|
1272
1269
|
<script src="../../prettify.js"></script>
|
|
1273
1270
|
<script>
|
|
@@ -268,7 +268,7 @@ export const ExpoIapConsole = createConsole();
|
|
|
268
268
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
269
269
|
Code coverage generated by
|
|
270
270
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
271
|
-
at 2025-
|
|
271
|
+
at 2025-12-07T08:40:10.740Z
|
|
272
272
|
</div>
|
|
273
273
|
<script src="../../prettify.js"></script>
|
|
274
274
|
<script>
|
|
@@ -410,7 +410,12 @@
|
|
|
410
410
|
<a name='L345'></a><a href='#L345'>345</a>
|
|
411
411
|
<a name='L346'></a><a href='#L346'>346</a>
|
|
412
412
|
<a name='L347'></a><a href='#L347'>347</a>
|
|
413
|
-
<a name='L348'></a><a href='#L348'>348</a
|
|
413
|
+
<a name='L348'></a><a href='#L348'>348</a>
|
|
414
|
+
<a name='L349'></a><a href='#L349'>349</a>
|
|
415
|
+
<a name='L350'></a><a href='#L350'>350</a>
|
|
416
|
+
<a name='L351'></a><a href='#L351'>351</a>
|
|
417
|
+
<a name='L352'></a><a href='#L352'>352</a>
|
|
418
|
+
<a name='L353'></a><a href='#L353'>353</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
414
419
|
<span class="cline-any cline-neutral"> </span>
|
|
415
420
|
<span class="cline-any cline-neutral"> </span>
|
|
416
421
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -494,6 +499,11 @@
|
|
|
494
499
|
<span class="cline-any cline-neutral"> </span>
|
|
495
500
|
<span class="cline-any cline-neutral"> </span>
|
|
496
501
|
<span class="cline-any cline-neutral"> </span>
|
|
502
|
+
<span class="cline-any cline-neutral"> </span>
|
|
503
|
+
<span class="cline-any cline-neutral"> </span>
|
|
504
|
+
<span class="cline-any cline-neutral"> </span>
|
|
505
|
+
<span class="cline-any cline-neutral"> </span>
|
|
506
|
+
<span class="cline-any cline-neutral"> </span>
|
|
497
507
|
<span class="cline-any cline-yes">4x</span>
|
|
498
508
|
<span class="cline-any cline-neutral"> </span>
|
|
499
509
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -594,7 +604,7 @@
|
|
|
594
604
|
<span class="cline-any cline-yes">4x</span>
|
|
595
605
|
<span class="cline-any cline-neutral"> </span>
|
|
596
606
|
<span class="cline-any cline-neutral"> </span>
|
|
597
|
-
<span class="cline-any cline-yes">
|
|
607
|
+
<span class="cline-any cline-yes">104x</span>
|
|
598
608
|
<span class="cline-any cline-neutral"> </span>
|
|
599
609
|
<span class="cline-any cline-neutral"> </span>
|
|
600
610
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -839,6 +849,11 @@ const COMMON_ERROR_CODE_MAP: Record<ErrorCode, string> = {
|
|
|
839
849
|
[ErrorCode.BillingUnavailable]: ErrorCode.BillingUnavailable,
|
|
840
850
|
[ErrorCode.FeatureNotSupported]: ErrorCode.FeatureNotSupported,
|
|
841
851
|
[ErrorCode.EmptySkuList]: ErrorCode.EmptySkuList,
|
|
852
|
+
[ErrorCode.PurchaseVerificationFailed]: ErrorCode.PurchaseVerificationFailed,
|
|
853
|
+
[ErrorCode.PurchaseVerificationFinishFailed]:
|
|
854
|
+
ErrorCode.PurchaseVerificationFinishFailed,
|
|
855
|
+
[ErrorCode.PurchaseVerificationFinished]:
|
|
856
|
+
ErrorCode.PurchaseVerificationFinished,
|
|
842
857
|
};
|
|
843
858
|
|
|
844
859
|
export const ErrorCodeMapping = {
|
|
@@ -1111,7 +1126,7 @@ export function getUserFriendlyErrorMessage(error: ErrorLike): string {
|
|
|
1111
1126
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1112
1127
|
Code coverage generated by
|
|
1113
1128
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1114
|
-
at 2025-
|
|
1129
|
+
at 2025-12-07T08:40:10.740Z
|
|
1115
1130
|
</div>
|
|
1116
1131
|
<script src="../../prettify.js"></script>
|
|
1117
1132
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2025-
|
|
119
|
+
at 2025-12-07T08:40:10.740Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../prettify.js"></script>
|
|
122
122
|
<script>
|