How to get user_ID from GooglePlay/AppStore?

Hello everybody!
It’s time we saved the player’s progress on the server, which means it’s time to identify the player.
I tried to find an answer on the forum but found nothing.
How to get user_ID from GooglePlay/AppStore?

2 Likes

Ok, some clarification.
I just need a unique user ID. Not device ID.
This is only necessary for us to find the last savegame of this user on our server.

It might not be the one you are looking for, but we have android_id through https://www.defold.com/ref/sys/#sys.get_sys_info

If you specifically need user_ID it might be possible to get it by creating your own NE function.

1 Like

We would have more approached this identifier: ad_ident

string “advertisingIdentifier” on iOS or advertising ID provided by Google Play on Android

1 Like

Is the intention that you should be able to move between devices, retaining progress if the same user account exists on both devices? If this is the case then you need an extension that allows you to get the Google/Apple user id.

If you simply need a unique id, valid on a single device, you could generate it on app start and persist it. A good Lua module for this is this one.

2 Likes