mobileflutteridfagoogle-advertising-id

How to retrieve Apple IDFA in Flutter?


How i can retrieve Apple IDFA in Flutter App? I have already tried advertising_id plugin, but it crashes on Android and doesn't retrieve ID at IOS.


Solution

  • Did you check this package?

    First add the package to your dependencies (pubspec.yaml)

    dependencies:
      advertising_id: ^0.9.2
    

    Then run get packages to install it. Then add it to your file:

    import 'package:advertising_id/advertising_id.dart';
    

    Then use it like:

    print(await AdvertisingId.id);
    

    I checked it and I couldn't make it work on iOS but it is working on Android. I hope this helps.