- Bug fixes.
- Added Capacitor 3.0 Support.
- iOS 14 App Tracking Transparency.
- iOS
- Android
- Web
Name | Returns | Type |
---|---|---|
getTrackingStatus | Promise |
IOSAppTrackingStatus |
requestPermission | Promise |
IOSAppTrackingStatus |
npm install capacitor-ios-app-tracking
npx cap sync
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
getTrackingStatus() => Promise<IOSAppTrackingStatus>)
requestPermission() => Promise<IOSAppTrackingStatus>)
import { AppTrackingTransparency } from "capacitor-ios-app-tracking";
useEffect(() => {
AppTrackingTransparency.getTrackingStatus().then((status) => {
console.log(status);
});
}, []);
import { AppTrackingTransparency } from "capacitor-ios-app-tracking";
useEffect(() => {
AppTrackingTransparency.requestPermission().then((status) => {
console.log(status);
});
}, []);
export interface IOSAppTrackingPlugin {
getTrackingStatus(): Promise<IOSAppTrackingResponse>;
requestPermission(): Promise<IOSAppTrackingResponse>;
}
interface IOSAppTrackingResponse {
code: string;
status: IOSAppTrackingStatus;
}
type IOSAppTrackingStatus =
| 'authorized'
| 'denied'
| 'unrequested'
| 'restricted';