getAdvertisingId static method

Future<String> getAdvertisingId()

Return GoogleAdvertisingId (if using FCM) or AOID (if using HMS)

NOTE: Since late 2021, if user opts out of Ad personalization, FCM ad_id will return bunch of zeros or empty

Implementation

static Future<String> getAdvertisingId() async {
  if(!Platform.isAndroid) return "";
  return await _channel.invokeMethod("Pushe.getAdvertisingId") ?? "";
}