Using @capgo/capacitor-age-range
Cross-platform age range detection plugin.
Install
bun add @capgo/capacitor-age-range
bunx cap sync
bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.
Import
import { AgeRange } from '@capgo/capacitor-age-range';
API at a glance
| Method | Description |
|---|---|
requestAgeRange |
Request the user's age range. |
Examples
requestAgeRange()
Request the user's age range.
import { AgeRange } from '@capgo/capacitor-age-range';
const result = await AgeRange.requestAgeRange({ ageGates: [13, 16, 18] });
if (result.status === 'SHARING') {
console.log('Age range:', result.ageLower, '-', result.ageUpper);
}
Full reference
Keep going from Using @capgo/capacitor-age-range
If you are using Using @capgo/capacitor-age-range to plan native plugin work, connect it with @capgo/capacitor-age-range for the implementation detail in @capgo/capacitor-age-range, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.