Consent screen
This screen lets a user visit the privacy and terms URL.
The user can then agree by checking off a checkbox and pressing the submit button.
At that point, the onAccept callback is triggered.
This page contains the following translation keys:
consent_titleconsent_introconsent_bodyReadthe privacy policyandthe terms and conditionsI understandReady to get started?Let's go
Example usage
Here is a simplified version of how this component is used in the template app:
import { useLocal } from '@healthblocks-io/core/local'
import PrivacyConsent from '@healthblocks-io/native/Consent'
function App() {
// Load most important data from async storage
const localState = useLocal()
if (!localState) return null
const [local, setLocal] = localState
// Require language selection
if (!local.language) return ...
// Require onboarding
if (!local.onboarding) return ...
// Store the date of consent to allow for future updates to the terms
if (!local.consent) {
return (
<PrivacyConsent
onAccept={() => setLocal({ consent: new Date().toJSON() })}
/>
)
}
}