expo-iap 6.5.0 → 6.5.1

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/README.md CHANGED
@@ -100,32 +100,24 @@ If expo-iap saves you time, a ⭐ on [hyodotdev/openiap](https://github.com/hyod
100
100
  ## Sponsors
101
101
 
102
102
  <p align="center">
103
- <a href="https://meta.com">
104
- <img src="https://openiap.dev/meta.svg" alt="Meta" height="80" align="middle">
105
- </a>
103
+ <a href="https://meta.com"><img src="https://openiap.dev/meta.svg" alt="Meta" height="80" align="middle"></a>
106
104
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
107
- <a href="https://developer.amazon.com/">
108
- <picture>
109
- <source media="(prefers-color-scheme: dark)" srcset="https://openiap.dev/sponsors/amazon-dark.webp">
110
- <img src="https://openiap.dev/sponsors/amazon.webp" alt="Amazon Developer" height="44" align="middle">
111
- </picture>
112
- </a>
105
+ <a href="https://developer.amazon.com/"><picture><source media="(prefers-color-scheme: dark)" srcset="https://openiap.dev/sponsors/amazon-dark.webp"><img src="https://openiap.dev/sponsors/amazon.webp" alt="Amazon Developer" height="44" align="middle"></picture></a>
106
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
107
+ <a href="https://codemagic.io/"><picture><source media="(prefers-color-scheme: dark)" srcset="https://openiap.dev/sponsors/codemagic-dark.svg"><img src="https://openiap.dev/sponsors/codemagic.svg" alt="Codemagic" height="22" align="middle"></picture></a>
113
108
  </p>
114
109
 
115
- Thank you to [Meta](https://meta.com) and [Amazon Developer](https://developer.amazon.com/) for supporting OpenIAP. [View sponsorship options](https://openiap.dev/sponsors).
110
+ Thank you to [Meta](https://meta.com), [Amazon Developer](https://developer.amazon.com/), and [Codemagic](https://codemagic.io/) for supporting OpenIAP. [View sponsorship options](https://openiap.dev/sponsors).
116
111
 
117
112
  ### In-kind support
118
113
 
119
114
  <p align="center">
120
- <a href="https://claude.com/contact-sales/claude-for-oss">
121
- <picture>
122
- <source media="(prefers-color-scheme: dark)" srcset="https://openiap.dev/sponsors/claude-dark.svg">
123
- <img src="https://openiap.dev/sponsors/claude.svg" alt="Claude" height="32" align="middle">
124
- </picture>
125
- </a>
115
+ <a href="https://claude.com/contact-sales/claude-for-oss"><picture><source media="(prefers-color-scheme: dark)" srcset="https://openiap.dev/sponsors/claude-dark.svg"><img src="https://openiap.dev/sponsors/claude.svg" alt="Claude" height="17" align="middle"></picture></a>
116
+ &nbsp;&nbsp;&nbsp;&nbsp;
117
+ <a href="https://codemagic.io/"><picture><source media="(prefers-color-scheme: dark)" srcset="https://openiap.dev/sponsors/codemagic-dark.svg"><img src="https://openiap.dev/sponsors/codemagic.svg" alt="Codemagic" height="19" align="middle"></picture></a>
126
118
  </p>
127
119
 
128
- [Claude for Open Source](https://claude.com/contact-sales/claude-for-oss) provides the Claude Ultra plan for the maintainer from July 20, 2026 to January 19, 2027.
120
+ [Claude for Open Source](https://claude.com/contact-sales/claude-for-oss) provides the Claude Ultra plan for the maintainer for 6 months.<br>[Codemagic](https://codemagic.io/) provides infrastructure support for OpenIAP.
129
121
 
130
122
  ### OpenCollective
131
123
 
@@ -142,13 +134,9 @@ We also recognize sponsors and backers through OpenCollective. The original reac
142
134
  Supported the project before the OpenIAP sponsor program: Nami for 30 months and Courier for 1 month.
143
135
 
144
136
  <p align="center">
145
- <a href="https://namiml.com">
146
- <img src="https://openiap.dev/sponsors/nami.webp" alt="Nami" height="40" align="middle">
147
- </a>
137
+ <a href="https://namiml.com"><img src="https://openiap.dev/sponsors/nami.webp" alt="Nami" height="20" align="middle"></a>
148
138
  &nbsp;&nbsp;&nbsp;&nbsp;
149
- <a href="https://www.courier.com/?utm_source=react-native-iap&utm_campaign=osssponsors">
150
- <img src="https://openiap.dev/sponsors/courier.webp" alt="Courier" height="24" align="middle">
151
- </a>
139
+ <a href="https://www.courier.com/?utm_source=react-native-iap&utm_campaign=osssponsors"><img src="https://openiap.dev/sponsors/courier.webp" alt="Courier" height="15" align="middle"></a>
152
140
  </p>
153
141
 
154
142
  [openiap-sponsors]: https://openiap.dev/sponsors
@@ -49,9 +49,16 @@ object ExpoIapHelper {
49
49
  internal fun rejectWithErrorEnvelope(
50
50
  promise: Promise,
51
51
  error: Exception,
52
+ fallbackCode: String = OpenIapError.ServiceUnavailable.CODE,
52
53
  ) {
53
- val openIapError = error as? OpenIapError ?: OpenIapError.ServiceUnavailable(error.message)
54
- promise.reject(openIapError.code, serializeErrorEnvelope(serializeOpenIapError(openIapError)), null)
54
+ val payload =
55
+ (error as? OpenIapError)?.let(::serializeOpenIapError)
56
+ ?: mapOf(
57
+ "code" to fallbackCode,
58
+ "message" to (error.message ?: OpenIapError.defaultMessage(fallbackCode)),
59
+ "platform" to "android",
60
+ )
61
+ promise.reject(payload["code"] as String, serializeErrorEnvelope(payload), null)
55
62
  }
56
63
 
57
64
  fun emitOrQueue(
@@ -201,14 +201,7 @@ class ExpoIapModule : Module() {
201
201
  if (!ok) {
202
202
  // Clear any buffered events from a failed init
203
203
  pendingEvents.clear()
204
- ExpoIapLog.failure("initConnection", IllegalStateException("Failed to initialize connection"))
205
- val error = OpenIapError.InitConnection.forProvider(context)
206
- promise.reject(
207
- error.code,
208
- error.message,
209
- null,
210
- )
211
- return@withLock
204
+ throw OpenIapError.InitConnection.forProvider(context)
212
205
  }
213
206
 
214
207
  // Mark ready then flush any buffered events
@@ -224,7 +217,7 @@ class ExpoIapModule : Module() {
224
217
  promise.resolve(true)
225
218
  } catch (e: Exception) {
226
219
  ExpoIapLog.failure("initConnection", e)
227
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.InitConnection.CODE, e.message, e)
220
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e, OpenIapError.InitConnection.CODE)
228
221
  }
229
222
  }
230
223
  }
@@ -250,11 +243,7 @@ class ExpoIapModule : Module() {
250
243
  promise.resolve(result)
251
244
  } catch (error: Exception) {
252
245
  ExpoIapLog.failure("endConnection", error)
253
- promise.reject(
254
- endConnectionErrorCode(error),
255
- error.message,
256
- error,
257
- )
246
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, error, endConnectionErrorCode(error))
258
247
  }
259
248
  }
260
249
  }
@@ -315,7 +304,7 @@ class ExpoIapModule : Module() {
315
304
  promise.resolve(payload)
316
305
  } catch (e: Exception) {
317
306
  ExpoIapLog.failure("getAvailableItems", e)
318
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, null)
307
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
319
308
  }
320
309
  }
321
310
  }
@@ -333,7 +322,7 @@ class ExpoIapModule : Module() {
333
322
  promise.resolve(null)
334
323
  } catch (e: Exception) {
335
324
  ExpoIapLog.failure("deepLinkToSubscriptionsAndroid", e)
336
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, null)
325
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
337
326
  }
338
327
  }
339
328
  }
@@ -378,7 +367,7 @@ class ExpoIapModule : Module() {
378
367
  promise.resolve(code)
379
368
  } catch (e: Exception) {
380
369
  ExpoIapLog.failure("getStorefront", e)
381
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
370
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
382
371
  }
383
372
  }
384
373
  }
@@ -510,7 +499,7 @@ class ExpoIapModule : Module() {
510
499
  promise.resolve(true)
511
500
  } catch (e: Exception) {
512
501
  ExpoIapLog.failure("restorePurchases", e)
513
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, null)
502
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
514
503
  }
515
504
  }
516
505
  }
@@ -522,7 +511,7 @@ class ExpoIapModule : Module() {
522
511
  promise.resolve(null)
523
512
  } catch (e: Exception) {
524
513
  ExpoIapLog.failure("finishTransaction", e)
525
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.DeveloperError.CODE, e.message, null)
514
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e, OpenIapError.DeveloperError.CODE)
526
515
  }
527
516
  }
528
517
  }
@@ -573,12 +562,13 @@ class ExpoIapModule : Module() {
573
562
  } catch (e: CancellationException) {
574
563
  throw e
575
564
  } catch (e: Exception) {
576
- val code = when (e) {
577
- is OpenIapError -> e.code
578
- is IllegalArgumentException -> OpenIapError.DeveloperError.CODE
579
- else -> OpenIapError.ServiceUnavailable.CODE
580
- }
581
- promise.reject(code, e.message, e)
565
+ val fallbackCode =
566
+ if (e is IllegalArgumentException) {
567
+ OpenIapError.DeveloperError.CODE
568
+ } else {
569
+ OpenIapError.ServiceUnavailable.CODE
570
+ }
571
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e, fallbackCode)
582
572
  }
583
573
  }
584
574
  }
@@ -600,7 +590,7 @@ class ExpoIapModule : Module() {
600
590
  promise.resolve(resultMap)
601
591
  } catch (e: Exception) {
602
592
  ExpoIapLog.failure("verifyPurchase", e)
603
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.VerificationFailed.CODE, e.message, e)
593
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e, OpenIapError.VerificationFailed.CODE)
604
594
  }
605
595
  }
606
596
  }
@@ -624,7 +614,7 @@ class ExpoIapModule : Module() {
624
614
  promise.resolve(resultMap)
625
615
  } catch (e: Exception) {
626
616
  ExpoIapLog.failure("verifyPurchaseWithProvider", e)
627
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.VerificationFailed.CODE, e.message, e)
617
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e, OpenIapError.VerificationFailed.CODE)
628
618
  }
629
619
  }
630
620
  }
@@ -642,7 +632,7 @@ class ExpoIapModule : Module() {
642
632
  promise.resolve(result)
643
633
  } catch (e: Exception) {
644
634
  ExpoIapLog.failure("getActiveSubscriptions", e)
645
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
635
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
646
636
  }
647
637
  }
648
638
  }
@@ -659,7 +649,7 @@ class ExpoIapModule : Module() {
659
649
  promise.resolve(hasActive)
660
650
  } catch (e: Exception) {
661
651
  ExpoIapLog.failure("hasActiveSubscriptions", e)
662
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
652
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
663
653
  }
664
654
  }
665
655
  }
@@ -685,7 +675,7 @@ class ExpoIapModule : Module() {
685
675
  promise.resolve(response)
686
676
  } catch (e: Exception) {
687
677
  ExpoIapLog.failure("isBillingProgramAvailableAndroid", e)
688
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
678
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
689
679
  }
690
680
  }
691
681
  }
@@ -711,7 +701,7 @@ class ExpoIapModule : Module() {
711
701
  promise.resolve(result.toJson())
712
702
  } catch (e: Exception) {
713
703
  ExpoIapLog.failure("getBillingChoiceInfoAndroid", e)
714
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
704
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
715
705
  }
716
706
  }
717
707
  }
@@ -743,7 +733,7 @@ class ExpoIapModule : Module() {
743
733
  promise.resolve(response)
744
734
  } catch (e: Exception) {
745
735
  ExpoIapLog.failure("createBillingProgramReportingDetailsAndroid", e)
746
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
736
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
747
737
  }
748
738
  }
749
739
  }
@@ -759,7 +749,7 @@ class ExpoIapModule : Module() {
759
749
  promise.resolve(openIapStore.showAlternativeBillingOnlyInformationDialog(activity).toJson())
760
750
  } catch (e: Exception) {
761
751
  ExpoIapLog.failure("showAlternativeBillingOnlyInformationDialogAndroid", e)
762
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
752
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
763
753
  }
764
754
  }
765
755
  }
@@ -793,7 +783,7 @@ class ExpoIapModule : Module() {
793
783
  promise.resolve(result.toJson())
794
784
  } catch (e: Exception) {
795
785
  ExpoIapLog.failure("showBillingProgramInformationDialogAndroid", e)
796
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
786
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
797
787
  }
798
788
  }
799
789
  }
@@ -828,7 +818,7 @@ class ExpoIapModule : Module() {
828
818
  promise.resolve(result.toJson())
829
819
  } catch (e: Exception) {
830
820
  ExpoIapLog.failure("showInAppMessagesAndroid", e)
831
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
821
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
832
822
  }
833
823
  }
834
824
  }
@@ -876,7 +866,7 @@ class ExpoIapModule : Module() {
876
866
  promise.resolve(result)
877
867
  } catch (e: Exception) {
878
868
  ExpoIapLog.failure("launchExternalLinkAndroid", e)
879
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
869
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
880
870
  }
881
871
  }
882
872
  }
@@ -890,7 +880,7 @@ class ExpoIapModule : Module() {
890
880
  promise.resolve(isAvailable)
891
881
  } catch (e: Exception) {
892
882
  ExpoIapLog.failure("isExternalPurchaseLinkAvailable", e)
893
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
883
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
894
884
  }
895
885
  }
896
886
  }
@@ -922,7 +912,7 @@ class ExpoIapModule : Module() {
922
912
  promise.resolve(result)
923
913
  } catch (e: Exception) {
924
914
  ExpoIapLog.failure("openExternalPurchaseLink", e)
925
- promise.reject((e as? OpenIapError)?.code ?: OpenIapError.ServiceUnavailable.CODE, e.message, e)
915
+ ExpoIapHelper.rejectWithErrorEnvelope(promise, e)
926
916
  }
927
917
  }
928
918
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,6BAA6B,CAAC;AAcrC,OAAO,KAAK,EAGV,sCAAsC,EAEtC,aAAa,EAEb,OAAO,EACP,gBAAgB,EAEhB,QAAQ,EAER,8BAA8B,EAC9B,UAAU,EAOV,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAM9B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,oBAAY,YAAY;IACtB,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;IAChC,kBAAkB,yBAAyB;IAC3C,wBAAwB,gCAAgC;IACxD;;;OAGG;IACH,+BAA+B,uCAAuC;IACtE,sGAAsG;IACtG,wBAAwB,+BAA+B;CACxD;AAED,KAAK,oBAAoB,GAAG;IAC1B,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC;IACzC,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC5C,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAC7B,OAAO,GACP,MAAM,GACN;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,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MAAM,WAAW,CAAC;AACvE,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAChC,0BAA0B,EAC1B,UAAU,EACV,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAC,yBAAyB,EAAC,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,+BAA+B,EAC/B,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,aAAa,IAAI,iBAAiB,EAClC,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC"}
package/build/index.js CHANGED
@@ -641,19 +641,17 @@ function validateAndroidPurchaseBranchOptions(request, type) {
641
641
  }
642
642
  /** Verify app acquisition; send Android integrity tokens to your backend. */
643
643
  export const verifyAppOwnership = async (options) => {
644
- if (isVegaOS() ||
645
- ExpoIapModule.USING_ONSIDE_SDK ||
646
- (Platform.OS !== 'ios' && Platform.OS !== 'android')) {
644
+ // Checked before the module is read: web has no native module to resolve.
645
+ if (Platform.OS !== 'ios' && Platform.OS !== 'android') {
647
646
  return {
648
647
  status: 'unknown',
649
648
  reason: 'unsupported',
650
- storeId: isVegaOS()
651
- ? 'amazon'
652
- : ExpoIapModule.USING_ONSIDE_SDK
653
- ? 'onside'
654
- : 'unknown',
649
+ storeId: isVegaOS() ? 'amazon' : 'unknown',
655
650
  };
656
651
  }
652
+ if (ExpoIapModule.USING_ONSIDE_SDK) {
653
+ return { status: 'unknown', reason: 'unsupported', storeId: 'onside' };
654
+ }
657
655
  return invokeNativeWithPurchaseError(() => ExpoIapModule.verifyAppOwnership(options ?? {}), nativePlatform(), {
658
656
  code: ErrorCode.ServiceError,
659
657
  });