discord / gamesdk-and-dispatch

Public issue tracker for the Discord Game SDK and Dispatch
22 stars 7 forks source link

Can't get current user in Unity #98

Closed slxdy closed 3 years ago

slxdy commented 3 years ago

I am trying to get my own username and id, but GetCurrentUser() throws an exception "ResultException: NotFound" Please help, how do i fix this.

And yes, the sdk it self works, i tried updating my activity

PixelNinja132 commented 3 years ago

This question is better asked in the #game-sdk channel in the developer server (discord.gg/discord-developers)

Are you 100% sure you are reading https://discord.com/developers/docs/game-sdk/users#getcurrentuser right?

And, have you made sure you are using the userManager as sampled in var user = userManager.GetCurrentUser();

And, just one last thing:

Before calling this function, you'll need to wait for the OnCurrentUserUpdate callback to fire after instantiating the User manager.

Are you doing this as well?

Some code samples would be good!

Thanks

Jump-Suit commented 3 years ago

If you followed the documentation: https://discord.com/developers/docs/game-sdk/users#getcurrentuser In blue text it states to call the userManager.OnCurrentUserUpdate BEFORE fetching getCurrentUser!

slxdy commented 3 years ago

If you followed the documentation: https://discord.com/developers/docs/game-sdk/users#getcurrentuser In blue text it states to call the userManager.OnCurrentUserUpdate BEFORE fetching getCurrentUser!

Oops, I probably missed that, thanks for help