expo-iap 3.1.25 → 3.1.27

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/src/index.ts CHANGED
@@ -471,7 +471,16 @@ export const requestPurchase: MutationField<'requestPurchase'> = async (
471
471
 
472
472
  if (!normalizedRequest?.sku) {
473
473
  throw new Error(
474
- 'Invalid request for iOS. The `sku` property is required and must be a string.',
474
+ 'Invalid request for iOS. The `sku` property is required and must be a string.\n\n' +
475
+ 'Expected format:\n' +
476
+ ' requestPurchase({\n' +
477
+ ' request: {\n' +
478
+ ' android: { skus: ["product_id"] },\n' +
479
+ ' ios: { sku: "product_id" }\n' +
480
+ ' },\n' +
481
+ ' type: "in-app"\n' +
482
+ ' })\n\n' +
483
+ 'See: https://hyochan.github.io/expo-iap/docs/api/methods/core-methods#requestpurchase',
475
484
  );
476
485
  }
477
486
 
@@ -510,7 +519,16 @@ export const requestPurchase: MutationField<'requestPurchase'> = async (
510
519
 
511
520
  if (!normalizedRequest?.skus?.length) {
512
521
  throw new Error(
513
- 'Invalid request for Android. The `skus` property is required and must be a non-empty array.',
522
+ 'Invalid request for Android. The `skus` property is required and must be a non-empty array.\n\n' +
523
+ 'Expected format:\n' +
524
+ ' requestPurchase({\n' +
525
+ ' request: {\n' +
526
+ ' android: { skus: ["product_id"] },\n' +
527
+ ' ios: { sku: "product_id" }\n' +
528
+ ' },\n' +
529
+ ' type: "in-app"\n' +
530
+ ' })\n\n' +
531
+ 'See: https://hyochan.github.io/expo-iap/docs/api/methods/core-methods#requestpurchase',
514
532
  );
515
533
  }
516
534
 
@@ -543,7 +561,16 @@ export const requestPurchase: MutationField<'requestPurchase'> = async (
543
561
 
544
562
  if (!normalizedRequest?.skus?.length) {
545
563
  throw new Error(
546
- 'Invalid request for Android. The `skus` property is required and must be a non-empty array.',
564
+ 'Invalid request for Android. The `skus` property is required and must be a non-empty array.\n\n' +
565
+ 'Expected format:\n' +
566
+ ' requestPurchase({\n' +
567
+ ' request: {\n' +
568
+ ' android: { skus: ["subscription_id"] },\n' +
569
+ ' ios: { sku: "subscription_id" }\n' +
570
+ ' },\n' +
571
+ ' type: "subs"\n' +
572
+ ' })\n\n' +
573
+ 'See: https://hyochan.github.io/expo-iap/docs/api/methods/core-methods#requestpurchase',
547
574
  );
548
575
  }
549
576