checkEntitlement method
Future<InappifySdkResult<bool> >
checkEntitlement(
- InappifyEntitlementCheckRequest request
inherited
Checks an entitlement, optionally refreshing customer information first.
Implementation
@override
Future<InappifySdkResult<bool>> checkEntitlement(
InappifyEntitlementCheckRequest request,
) async {
final cancelled = _preCancelled<bool>(
'checkEntitlement',
request.cancellation,
);
if (cancelled != null) return cancelled;
return _run<bool>(
'checkEntitlement',
action: () async {
final raw = await _bridge.call(
'checkEntitlement',
positionalArguments: <Object?>[
request.identifier,
<String, Object?>{'forceRefresh': request.forceRefresh},
],
cancellation: request.cancellation,
injectAbortSignal: request.cancellation != null,
);
if (request.forceRefresh) _readCustomerPropertyBestEffort();
return InappifyWebPayloadCodec.boolean(
raw,
field: 'entitlement result',
);
},
cancellation: request.cancellation,
);
}