question

chrismccole1 avatar image
chrismccole1 asked

WebGL Generate CustomId

I am trying to figure out the best way to allow anonymous logins on a WebGL game built in Unity. My first thought was to go for Unity's built-in SystemInfo.deviceUniqueIdentifier, however, after testing this out, I found that this functionality is not supported in WebGL, the only alternative I can think of is to generate an id on my own and save it to the cookies (if one doesn't exist and they have chosen not to link an account explicitly).

What is the best practice for generating an ID like this dynamically that I can guarantee is unique across all of PlayFab, within the WebGL constraint.

Thanks for your help!
Chris

unity3dAuthentication
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image
Seth Du answered

You may consider using GUID as the custom ID of the player account. Please refer to Brendan’s answer in this thread: How to get unique id on the clinet (WebGL) - Playfab Community

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chrismccole1 avatar image chrismccole1 commented ·

This is perfect! Thanks so much for pointing this out. It worked perfectly!

0 Likes 0 ·
Tuomas Karmakallio avatar image
Tuomas Karmakallio answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.