How can I get the device id through code?

hi,
I want to get the device id of the device on which my game is playing. I don’t know how to get it through code though. any help will be appreciated.
Thanks!

As far as I know, you can’t. I’ve searched for js libraries that can do it. And there isn’t no one that can.
My game runs in social network. So I use players social ID instead.

I don’t know of a way to do this in Creator but perhaps it can be done. I saw this: https://stackoverflow.com/questions/16869482/how-to-get-unique-device-hardware-id-in-android#16869491

hi,
In that case can you provide a link(s) that talks about how to make a custom plugin for cocos creator in android(and also in iOS).
thanks in advance!

We don’t really have a plugin API that is suitable at this time. Perhaps in the future this will be improved.

Are you target for android only? Because trying access device id on ios (and device id api) was prohibited by apple a few years ago, and will lead to immediate reject from appstore.

1 Like