インスタンスプロパティ
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 になります。現在の使用権情報は、非消耗品、非更新サブスクリプション、および自動更新サブスクリプションにのみ適用されます。以下の例では、製品の現在の使用権を確認します。
- guard let verificationResult = await product.currentEntitlement else {
// The user isn’t currently entitled to this product.
return
- }
- switch verificationResult {
- case .verified(let transaction):
// Check the transaction and give the user access to purchased
// content as appropriate.
...
- case .unverified(let transaction, let verificationError):
// Handle unverified transactions based
// on your business model.
...
- }
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ
トップへ