インスタンスプロパティ


currentEntitlement


ユーザに製品の使用権を与える取引。


iOS 15.0+ iPadOS 15.0+ macOS 12.0+

tvOS 15.0+ visionOS 1.0+ watchOS 8.0+

var currentEntitlement: VerificationResult<Transaction>? { get async }




議論


ユーザが現在この製品の使用権を持っていない場合、この値は nil になります。現在の使用権情報は、非消耗品、非更新サブスクリプション、および自動更新サブスクリプションにのみ適用されます。以下の例では、製品の現在の使用権を確認します。


  1. guard let verificationResult = await product.currentEntitlement else {
  2. // The user isn’t currently entitled to this product.
  3. return
  4. }
  5. switch verificationResult {
  6. case .verified(let transaction):
  7. // Check the transaction and give the user access to purchased
  8. // content as appropriate.
  9. ...
  10. case .unverified(let transaction, let verificationError):
  11. // Handle unverified transactions based
  12. // on your business model.
  13. ...
  14. }













トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ












トップへ