How to get DeviceID? Can you help me,please!

Now, i having a task about getting the deviceID of users with purpose to prevent cloning many account from one player. But now i still not found the way to deal with this issue, can you help me now?
I tried to do following this post but seem it’s very old to using and now it’s not working.
https://github.com/jgranick/openfl-native/blob/master/flash/system/System.hx
Thank so much! Sorry for bad my english !

Hello :slight_smile: The openfl-native repo is deprecated, are you sure you mean to be using that?

I looked around in the current OpenFL API but can’t find anything related to device ID. Do you want to prevent players from copying SharedObjects from one device to another?

1 Like

Thank u for response, now i want to restrict players from creating the new account each when their account’s not enough money to playing game by way using the device id to detect the new account is created from same device or not.

I looked around some more but don’t see anything. Maybe ask on the chat channel? https://fleep.io/chat?cid=gEdNbSUoSLqHv_Avpr8ErQ

1 Like

try hyp-system :smiley:

1 Like

Ok thank Mr Kiennt, let’s me check

In java it looks like

import android.provider.Settings.Secure;
private String android_id = Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID);

(http://stackoverflow.com/a/2785493)
is a good way to get an ID, with some limitations https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID

Not sure if you need to create a native extension just for that or if JNI can handle it.

1 Like

Thank for your help, i will try to use code native