【问题标题】:How to retrieve Apple IDFA in Flutter?如何在 Flutter 中检索 Apple IDFA?
【发布时间】:2019-11-14 03:35:55
【问题描述】:

如何在 Flutter App 中检索 Apple IDFA?我已经尝试过 ads_id 插件,但它在 Android 上崩溃并且在 IOS 上无法检索 ID。

【问题讨论】:

    标签: mobile flutter idfa google-advertising-id


    【解决方案1】:

    你检查this package了吗?

    首先将包添加到您的依赖项(pubspec.yaml)

    dependencies:
      advertising_id: ^0.9.2
    

    然后运行 ​​get packages 来安装它。然后将其添加到您的文件中:

    import 'package:advertising_id/advertising_id.dart';
    

    然后像这样使用它:

    print(await AdvertisingId.id);
    

    我检查了它,我无法让它在 iOS 上运行,但它在 Android 上运行。我希望这会有所帮助。

    【讨论】:

    • 确保更新您的 info.plist 文件以确保该软件包适用于 iOS,只需包含使用说明 NSUserTrackingUsageDescription使用说明
    猜你喜欢
    • 2012-10-08
    • 2020-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    • 2021-05-05
    • 2015-10-25
    • 1970-01-01
    相关资源
    最近更新 更多