advertising_id 2.6.0 copy "advertising_id: ^2.6.0" to clipboard
advertising_id: ^2.6.0 copied to clipboard

A Flutter plugin to access advertising ID.Wraps ASIdentifierManager.advertisingIdentifier (on iOS) and advertising ID (on Android).

pub package

advertising_id #

A Flutter plugin to access advertising ID.

Wraps ASIdentifierManager.advertisingIdentifier (on iOS) and advertising ID (on Android).

Getting Started #

Run this command

 flutter pub add advertising_id

This will add a line like this to your package's pubspec.yaml

dependencies:
  ....
  advertising_id: ^2.6.0

Usage #

AdvertisingId.id #

Get advertising ID.

String? advertisingId;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
  advertisingId = await AdvertisingId.id(true);
} on PlatformException {
  advertisingId = null;
}

AdvertisingId.isLimitAdTrackingEnabled #

Retrieves whether the user has limit ad tracking enabled or not.

bool? isLimitAdTrackingEnabled;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
  isLimitAdTrackingEnabled = await AdvertisingId.isLimitAdTrackingEnabled;
} on PlatformException {
  isLimitAdTrackingEnabled = false;
}
30
likes
130
pub points
97%
popularity

Publisher

unverified uploader

A Flutter plugin to access advertising ID.Wraps ASIdentifierManager.advertisingIdentifier (on iOS) and advertising ID (on Android).

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on advertising_id