Other Classes
The following classes are available globally.
-
Onboarding ID Store for a single user
See moreDeclaration
Swift
open class SingleUserOnboardingIDManager : OnboardingIDManaging
-
Class that provides localized Usage Data Collection UsageCollectionConsentStep, Opt-in, and Opt-out alerts.
Manages the Usage User Consent Handling. The version for each user consent form will be stored in the
credentialStore
of theOnboardingContext
which is used to decide if a newer version of the form should be presented in the next run. If a new version for the form is present, the form will be displayed in the next run to request user confirmation.Usage
See moreSimplest model - default single page form. let UsageCollectionConsentStep = UsageCollectionConsentStep() Creates a localized title and body that will collect user preference for usage data collection. Customization model - allow customized single page form. let title = "Custom UsageCollectionConsent Title" let body = "Custom UsageCollectionConsent Body" let UsageCollectionConsentStep = UsageCollectionConsentStep(title: title, body: body) Customization model with additional page - allow customized multi page form. var spDpPage = UserConsentPageContent() spDpPage.title = "Data Privacy Details" spDpPage.body = "Your customized data privacy text" var spSecPage = UserConsentPageContent() spSecPage.title = "Security Details" spSecPage.body = "Your customized security text" let UsageCollectionConsentStep = UsageCollectionConsentStep(title: title, body: body, additionalUserPageContent: [spDpPage, spSecPage]) User selection will be enacted, and will be published in context. Response can be accessed as follows in AppDelegate onboarded delegate method using default key: if let consent = onboardingContext.info[.usageCollectionConsentResponseInfoKey] { or an alternate key if it was set on the step as: onboardingContext.info[yourUsageStep.usageConsentResponseInfoKey] Class also contains both localized and custom opt-in and opt-out alerts that may be used to prompt user as needed. Intended use for these helper methods: Obtain current user state: if(Usage.shared.hasConsentForUser(userUUID)) Then call whatever is appropriate for your situation. - either opt-out: UsageCollectionConsentStep.UsageCollectionConsentOptOut(viewController:… or opt-in: UsageCollectionConsentStep.UsageCollectionConsentOptIn(viewController:… Default opt-in default model called from your app: UsageCollectionConsentStep.UsageCollectionConsentOptIn(viewController: self) { response in if response { Usage.shared.consentForUser(userUUID, given: response) } } Customized opt-in model called from your app: UsageCollectionConsentStep.UsageCollectionConsentOptIn(viewController: self, title: "Custom Opt-in Title", message: "Custom Opt-in Message") ... Default opt-out default model called from your app: UsageCollectionConsentStep.UsageCollectionConsentOptOut(viewController: self) { response in if response { Usage.shared.consentForUser(userUUID, given: !response) } } Customized opt-out model called from your app: UsageCollectionConsentStep.UsageCollectionConsentOptOut(viewController: self, title: "Custom Opt-out Title", message: "Custom Opt-out Message") ...
Declaration
Swift
open class UsageCollectionConsentStep : OnboardingStep, FUIUserConsentViewControllerDelegate