ios - Game Center. Get real name -


i want know real name of local player, gklocalplayer's displayname return "me", not real name.

code use:

 void (^completitionhandler)(nsarray *, nserror *) = ^(nsarray *players, nserror *error) {       (gkplayer *p in players) {       nsstring *alies = p.alies;       nsstring *name = p.displayname;       nslog(@"name = %@",name);   //not real name, "me"     }   } 

not sure displayname can used retrieve local user full name. apple's documentation:

player objects provide details players

when game needs details particular player, retrieves details making query game center. retrieve information player using player’s player identifier. game kit returns details game in gkplayer object.

  • displayname:

    a user-readable string can display player in own user interface. example, in network match, might show display names each player in match knows playing against.

    the display name player depends on whether player friend of local player authenticated on device. if player friend of local player, display name actual name of player. if player not friend, display name player’s alias.

it meant retrieve name of other players. then, if asking displayname of local player, makes sense returns "me", since current user of device. guess has privacy policy.

possible workaround:

maybe, local user id , use try retrieve real name list of players id. not know if taken friend of or not.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -