getAdvertisingId static method

Future<String> getAdvertisingId()

Implementation

static Future<String> getAdvertisingId() async {
  if (requestAdvertiserId) {
    try {
      return await AdvertisingId.id(true) ?? "Unknown";
    } on PlatformException {
      return "Unknown";
    }
  } else {
    return "Unknown";
  }
}