I’m trying to get the player picture in Gamecenter, but nothing happens.
Anyone know how to do this?
local function requestPhotoCallback( event )
Photo = event.data.photo
end
local function requestCallback( event )
\_G.PlayerName = event.data.alias
\_G.PlayerID = event.data.playerID
gameNetwork.request( "loadPlayerPhoto",
{
playerID = \_G.PlayerID,
size="Small", -- "Small" or "Normal"
listener=requestPhotoCallback
})
end
local function finishAuth(event)
\_G.gamenetworkEnabled = event.data
gameNetwork.request( "loadLocalPlayer", { listener=requestCallback } )
end
function authorize()
gameNetwork.init("gamecenter", finishAuth)
end
authorize()
Above is the code i use to authorize, get playerid, and request the photo. XCode console doesn’t give any errors, but I don’t know how to display that picture.
[import]uid: 50459 topic_id: 32094 reply_id: 332094[/import]