@@ -340,6 +340,78 @@ public protocol PurchasesType: AnyObject {
340
340
@available ( iOS 13 . 0 , macOS 10 . 15 , tvOS 13 . 0 , watchOS 6 . 2 , * )
341
341
func purchase( package : Package ) async throws -> PurchaseResultData
342
342
343
+ /**
344
+ * This method will post all purchases associated with the current App Store account to RevenueCat and become
345
+ * associated with the current ``appUserID``. If the receipt is being used by an existing user, the current
346
+ * ``appUserID`` will be aliased together with the ``appUserID`` of the existing user.
347
+ * Going forward, either ``appUserID`` will be able to reference the same user.
348
+ *
349
+ * You shouldn't use this method if you have your own account system. In that case "restoration" is provided
350
+ * by your app passing the same ``appUserID`` used to purchase originally.
351
+ *
352
+ * - Note: This may force your users to enter the App Store password so should only be performed on request of
353
+ * the user. Typically with a button in settings or near your purchase UI. Use
354
+ * ``Purchases/syncPurchases(completion:)`` if you need to restore transactions programmatically.
355
+ *
356
+ * - Warning: Receiving a ``CustomerInfo`` instead of an error does not imply that the user has any
357
+ * entitlements, simply that the process was successful. You must verify the ``CustomerInfo/entitlements``
358
+ * to confirm that they are active.
359
+ */
360
+ func restorePurchases( completion: ( ( CustomerInfo ? , PublicError ? ) -> Void ) ? )
361
+
362
+ /**
363
+ * This method will post all purchases associated with the current App Store account to RevenueCat and become
364
+ * associated with the current ``appUserID``. If the receipt is being used by an existing user, the current
365
+ * ``appUserID`` will be aliased together with the ``appUserID`` of the existing user.
366
+ * Going forward, either ``appUserID`` will be able to reference the same user.
367
+ *
368
+ * You shouldn't use this method if you have your own account system. In that case "restoration" is provided
369
+ * by your app passing the same ``appUserID`` used to purchase originally.
370
+ *
371
+ * - Note: This may force your users to enter the App Store password so should only be performed on request of
372
+ * the user. Typically with a button in settings or near your purchase UI. Use
373
+ * ``Purchases/syncPurchases(completion:)`` if you need to restore transactions programmatically.
374
+ *
375
+ * - Warning: Receiving a ``CustomerInfo`` instead of an error does not imply that the user has any
376
+ * entitlements, simply that the process was successful. You must verify the ``CustomerInfo/entitlements``
377
+ * to confirm that they are active.
378
+ */
379
+ @available ( iOS 13 . 0 , macOS 10 . 15 , tvOS 13 . 0 , watchOS 6 . 2 , * )
380
+ func restorePurchases( ) async throws -> CustomerInfo
381
+
382
+ /**
383
+ * This method will post all purchases associated with the current App Store account to RevenueCat and
384
+ * become associated with the current ``appUserID``.
385
+ *
386
+ * If the receipt is being used by an existing user, the current ``appUserID`` will be aliased together with
387
+ * the ``appUserID`` of the existing user.
388
+ * Going forward, either ``appUserID`` will be able to reference the same user.
389
+ *
390
+ * - Warning: This function should only be called if you're not calling any purchase method.
391
+ *
392
+ * - Note: This method will not trigger a login prompt from App Store. However, if the receipt currently
393
+ * on the device does not contain subscriptions, but the user has made subscription purchases, this method
394
+ * won't be able to restore them. Use ``Purchases/restorePurchases(completion:)`` to cover those cases.
395
+ */
396
+ func syncPurchases( completion: ( ( CustomerInfo ? , PublicError ? ) -> Void ) ? )
397
+
398
+ /**
399
+ * This method will post all purchases associated with the current App Store account to RevenueCat and
400
+ * become associated with the current ``appUserID``.
401
+ *
402
+ * If the receipt is being used by an existing user, the current ``appUserID`` will be aliased together with
403
+ * the ``appUserID`` of the existing user.
404
+ * Going forward, either ``appUserID`` will be able to reference the same user.
405
+ *
406
+ * - Warning: This function should only be called if you're not calling any purchase method.
407
+ *
408
+ * - Note: This method will not trigger a login prompt from App Store. However, if the receipt currently
409
+ * on the device does not contain subscriptions, but the user has made subscription purchases, this method
410
+ * won't be able to restore them. Use ``Purchases/restorePurchases(completion:)`` to cover those cases.
411
+ */
412
+ @available ( iOS 13 . 0 , macOS 10 . 15 , tvOS 13 . 0 , watchOS 6 . 2 , * )
413
+ func syncPurchases( ) async throws -> CustomerInfo
414
+
343
415
#if !ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION
344
416
345
417
/**
@@ -443,78 +515,6 @@ public protocol PurchasesType: AnyObject {
443
515
@available ( iOS 13 . 0 , macOS 10 . 15 , tvOS 13 . 0 , watchOS 6 . 2 , * )
444
516
func purchase( package : Package , promotionalOffer: PromotionalOffer ) async throws -> PurchaseResultData
445
517
446
- /**
447
- * This method will post all purchases associated with the current App Store account to RevenueCat and become
448
- * associated with the current ``appUserID``. If the receipt is being used by an existing user, the current
449
- * ``appUserID`` will be aliased together with the ``appUserID`` of the existing user.
450
- * Going forward, either ``appUserID`` will be able to reference the same user.
451
- *
452
- * You shouldn't use this method if you have your own account system. In that case "restoration" is provided
453
- * by your app passing the same ``appUserID`` used to purchase originally.
454
- *
455
- * - Note: This may force your users to enter the App Store password so should only be performed on request of
456
- * the user. Typically with a button in settings or near your purchase UI. Use
457
- * ``Purchases/syncPurchases(completion:)`` if you need to restore transactions programmatically.
458
- *
459
- * - Warning: Receiving a ``CustomerInfo`` instead of an error does not imply that the user has any
460
- * entitlements, simply that the process was successful. You must verify the ``CustomerInfo/entitlements``
461
- * to confirm that they are active.
462
- */
463
- func restorePurchases( completion: ( ( CustomerInfo ? , PublicError ? ) -> Void ) ? )
464
-
465
- /**
466
- * This method will post all purchases associated with the current App Store account to RevenueCat and become
467
- * associated with the current ``appUserID``. If the receipt is being used by an existing user, the current
468
- * ``appUserID`` will be aliased together with the ``appUserID`` of the existing user.
469
- * Going forward, either ``appUserID`` will be able to reference the same user.
470
- *
471
- * You shouldn't use this method if you have your own account system. In that case "restoration" is provided
472
- * by your app passing the same ``appUserID`` used to purchase originally.
473
- *
474
- * - Note: This may force your users to enter the App Store password so should only be performed on request of
475
- * the user. Typically with a button in settings or near your purchase UI. Use
476
- * ``Purchases/syncPurchases(completion:)`` if you need to restore transactions programmatically.
477
- *
478
- * - Warning: Receiving a ``CustomerInfo`` instead of an error does not imply that the user has any
479
- * entitlements, simply that the process was successful. You must verify the ``CustomerInfo/entitlements``
480
- * to confirm that they are active.
481
- */
482
- @available ( iOS 13 . 0 , macOS 10 . 15 , tvOS 13 . 0 , watchOS 6 . 2 , * )
483
- func restorePurchases( ) async throws -> CustomerInfo
484
-
485
- /**
486
- * This method will post all purchases associated with the current App Store account to RevenueCat and
487
- * become associated with the current ``appUserID``.
488
- *
489
- * If the receipt is being used by an existing user, the current ``appUserID`` will be aliased together with
490
- * the ``appUserID`` of the existing user.
491
- * Going forward, either ``appUserID`` will be able to reference the same user.
492
- *
493
- * - Warning: This function should only be called if you're not calling any purchase method.
494
- *
495
- * - Note: This method will not trigger a login prompt from App Store. However, if the receipt currently
496
- * on the device does not contain subscriptions, but the user has made subscription purchases, this method
497
- * won't be able to restore them. Use ``Purchases/restorePurchases(completion:)`` to cover those cases.
498
- */
499
- func syncPurchases( completion: ( ( CustomerInfo ? , PublicError ? ) -> Void ) ? )
500
-
501
- /**
502
- * This method will post all purchases associated with the current App Store account to RevenueCat and
503
- * become associated with the current ``appUserID``.
504
- *
505
- * If the receipt is being used by an existing user, the current ``appUserID`` will be aliased together with
506
- * the ``appUserID`` of the existing user.
507
- * Going forward, either ``appUserID`` will be able to reference the same user.
508
- *
509
- * - Warning: This function should only be called if you're not calling any purchase method.
510
- *
511
- * - Note: This method will not trigger a login prompt from App Store. However, if the receipt currently
512
- * on the device does not contain subscriptions, but the user has made subscription purchases, this method
513
- * won't be able to restore them. Use ``Purchases/restorePurchases(completion:)`` to cover those cases.
514
- */
515
- @available ( iOS 13 . 0 , macOS 10 . 15 , tvOS 13 . 0 , watchOS 6 . 2 , * )
516
- func syncPurchases( ) async throws -> CustomerInfo
517
-
518
518
/**
519
519
* Computes whether or not a user is eligible for the introductory pricing period of a given product.
520
520
* You should use this method to determine whether or not you show the user the normal product price or
0 commit comments