How to get unique device id in flutter?

前端 未结 6 1638
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 16:28

In Android we have, Settings.Secure.ANDROID_ID. I do not know the iOS equivalent. Is there a flutter plugin or a way to get a unique device id for both Android

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 17:05

    If you're serving ads you can use ASIdentifierManager. You should only use it for ads. There is no general UDID mechanism provided by the OS on iOS, for privacy reasons.

    If you're using firebase_auth plugin you could signInAnonymously and then use the id of the FirebaseUser. This will give you an identifier that is specific to your Firebase app.

提交回复
热议问题