Kinvey-Xamarin: How to recieve Data from a User instance? -
i'm working on kinvey project right now, , i'm having problems reading username or special attributes user instance. first tried same way getting _user.id calling _user.username, didnt return anything(but id did curiously). searched on google, there weren't articles it. hope can help, appreciated!
for special attributes, use .attributes array on user class. code:
console.writeline ("custom attribute is: " + kinveyclient.user ().attributes["myattribute"]); for username, try .username() seems must explicit retrieval of user object before field populated
user retrieved; try { retrieved = await kinveyclient.user().retrieveasync(); } catch (exception e) { console.writeline("{0} caught exception: ", e); retrieved = null; } console.writeline ("logged in as: " + retrieved.username ); console.writeline ("custom attribute is: " + retrieved.attributes["myattribute"]); documentation: http://devcenter.kinvey.com/xamarin/guides/users#userclass
(answer applies sdk version 1.6.11)
Comments
Post a Comment