You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OCLicense set of classes allow gating and granting access to features through an extensible number of different mechanisms through a single, unified interface:
OCLicenseFeature represents a particular feature for which access is gated.
OCLicenseProduct represents a product and is defined by a collection of features.
for an IAP unlocking a single feature, that product would be defined by that single feature
for an Unlock all IAP, that product would be defined by all features
this allows creating tailored products consisting of a particular feature set, representing actual products
OCLicenseEnvironment encapsulates information on an environment against which the authorization to use a product should be checked
typically defined by host name, TLS certificate, etc.
OCLicenseEntitlement represents the entitlement to use a product. An entitlement
identifies its origin: where does it come from?
includes an expiryDate property (to allow trials + subscription expirations)
provides information on validity and applicability:
validity: if this entitlement should be considered at all (i.e. has not expired)
applicability: if this entitlement actually authorizes the use of a product in a certain OCLicenseEnvironment
can limit the authorization to use a product/feature to a certain domain/TLS certificate/public key
OCLicenseOffer represents an offer to purchase a product
OCLicenseProvider retrieve and provide information
about licensed/purchased products in the form of OCLicenseEntitlements, sourced from f.ex.
In App Purchases
Subscriptions
License Information pulled from a server
App Store Receipt original purchase date
about offers in the form of OCLicenseOffer, source from f.ex.
StoreKit (App Store)
OCLicenseManager
puts all these pieces together and provides APIs to determine if the usage of a certain feature is allowed
allows observation of single or groups of products and features in a particular environment and notify on change (handled through OCLicenseObserver)
[OCLicenseManager.sharedLicenseManager observeProducts:nilfeatures:@[ @"product.document-scanner" ] environment:core.environment withOwner:selfupdateHandler:^(OCLicenseObserver *observer, BOOL isInitial, OCLicenseAuthorizationStatus authorizationStatus){
// Handle updates to authorization status to use the document scanner feature
}];
The information in this issue has been updated and extended and can now be found at information can now be found in the repository, where it continues to be maintained.
Licensing
Overview
The
OCLicense
set of classes allow gating and granting access to features through an extensible number of different mechanisms through a single, unified interface:OCLicenseFeature
represents a particular feature for which access is gated.OCLicenseProduct
represents a product and is defined by a collection of features.OCLicenseEnvironment
encapsulates information on an environment against which the authorization to use a product should be checkedOCLicenseEntitlement
represents the entitlement to use a product. An entitlementexpiryDate
property (to allow trials + subscription expirations)OCLicenseEnvironment
OCLicenseOffer
represents an offer to purchase a productOCLicenseProvider
retrieve and provide informationOCLicenseEntitlement
s, sourced from f.ex.OCLicenseOffer
, source from f.ex.OCLicenseManager
OCLicenseObserver
)Hierarchy
Sessions
OCLicenseEnvironment
OCLicenseManager
OCLicenseFeature
sOCLicenseProduct
sOCLicenseProvider
sOCLicenseEntitlement
sOCLicenseOffer
sOCLicenseObserver
Examples
Registering features and products
Determining state and reacting to changes
Reference
App Store Receipt parsing
The text was updated successfully, but these errors were encountered: