You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

capacitor-plugin-apptrackingios

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-plugin-apptrackingios

app tracking alert for ios

latest
Source
npmnpm
Version
0.0.22
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

capacitor-plugin-apptrackingios

A Capacitor plugin for handling App Tracking Transparency on iOS.

Install

npm install capacitor-plugin-apptrackingios
npx cap sync

iOS Setup

Configure Info.plist

Add the NSUserTrackingUsageDescription key to your app's Info.plist file with a description of why you're requesting tracking authorization:

<key>NSUserTrackingUsageDescription</key>
<string>We use tracking data to provide personalized ads and improve your experience.</string>

API

  • getStatus()
  • requestPermission()
  • Type Aliases

App Tracking Transparency plugin for Capacitor

getStatus()

getStatus() => any

Get the current tracking authorization status.

On iOS 14+, this returns the current App Tracking Transparency authorization status. On iOS versions below 14, this will always return 'authorized'. On web platforms, this will always return 'authorized'.

Returns: any

Since: 1.0.0

requestPermission()

requestPermission() => any

Request tracking authorization from the user.

On iOS 14+, this will prompt the user with the App Tracking Transparency permission dialog. On iOS versions below 14, this will always return 'authorized' without showing a prompt. On web platforms, this will always return 'authorized' without showing a prompt.

Note: This plugin includes a workaround for a bug in iOS 17.4+ where the tracking authorization status may incorrectly return 'denied' when it should be 'notDetermined'.

Returns: any

Since: 1.0.0

Type Aliases

TrackingStatus

Possible tracking authorization status values

'notDetermined' | 'restricted' | 'denied' | 'authorized'

Usage

import { AppTrackingPlugin } from 'capacitor-plugin-apptrackingios';

// Check current status
const checkStatus = async () => {
  const { status } = await AppTrackingPlugin.getStatus();
  console.log('Current tracking status:', status);
  return status;
};

// Request permission
const requestPermission = async () => {
  const { status } = await AppTrackingPlugin.requestPermission();
  console.log('Tracking permission status:', status);
  return status;
};

// Example usage in a component
const initializeTracking = async () => {
  const currentStatus = await checkStatus();
  
  if (currentStatus === 'notDetermined') {
    // Only request if not determined yet
    const newStatus = await requestPermission();
    // Handle the user's choice
    if (newStatus === 'authorized') {
      // User allowed tracking
      console.log('User allowed tracking');
    } else {
      // User denied tracking
      console.log('User denied tracking');
    }
  }
};

iOS 17.4+ Bug Handling

This plugin includes a workaround for a bug in iOS 17.4+ where the tracking authorization status may incorrectly return 'denied' when it should be 'notDetermined'. The plugin automatically detects this condition and handles it appropriately.

License

MIT

Keywords

capacitor

FAQs

Package last updated on 20 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts