capacitor-app-tracking-transparency
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Capacitor App Tracking Transparency plugin

Available methods:

  • getStatus(): Promise<AppTrackingTransparencyStatus>
  • requestPermission(): Promise<AppTrackingTransparencyStatus>

Usage example:

  1. In your module (e.g. app.module.ts)
...
import { AppTrackingTransparency } from 'capacitor-app-tracking-transparency'

@NgModule({
	...
	providers: [
		...
		AppTrackingTransparency,
	],
})
export class AppModule {}
  1. In your component or service (e.g. permission.service.ts)
...
import { AppTrackingTransparency, AppTrackingTransparencyStatus } from 'capacitor-app-tracking-transparency'

@Injectable()
export class PermissionService {
	constructor(private att: AppTrackingTransparency) {}

    async requestATT() {
		const status = await this.att.getStatus()
		if(status === AppTrackingTransparencyStatus.notDetermined) {
			const new_status = await this.att.requestPermission()
		}
	}
}

BREAKING CHANGES in 2.x.x version

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i capacitor-app-tracking-transparency

    Weekly Downloads

    9

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    16.4 kB

    Total Files

    18

    Last publish

    Collaborators

    • rediska1114