Get friend username from friends list

Current, friends.getAll() will only return following informations in the event.response table:

‘_id’,

‘created_at’,

‘friend_id’,

‘updated_at’.

‘user_id’

All fields have ‘id’ keywords are string like this : ‘517e28c72bef5a6e6a000000’

Is there a way we can retrive the username of friends? because user name will be used when list out player’s friends

Hi @Jadynut,

What is shown when you access the “username”, “first_name”, and “last_name” parameters? Does it return the proper information for you?

Brent

Brent,

Here is the full debug information returned by friends.getAll() , as you can see there have no username field:

2013-04-30 10:59:16.707 Corona Simulator[533:f03] Corona Cloud: Friends: [{"_id":“517e28c72bef5a6e6a000006”,“created_at”:“2013-04-29T08:01:11+00:00”,“friend_id”:“517cd8dd2bef5acfc0000001”,“updated_at”:“2013-04-29T08:01:11+00:00”,“user_id”:“517cd8dd2bef5acfc0000001”},{"_id":“517e28d22bef5a6e6a000007”,“created_at”:“2013-04-29T08:01:22+00:00”,“friend_id”:“517e28c72bef5a6e6a000006”,“updated_at”:“2013-04-29T08:01:22+00:00”,“user_id”:“517cd8dd2bef5acfc0000001”}]

Hi,

What you will need to do is use function getProfile( userId ) by passing the ‘user_id’.

Thanks

-Mohamed

Hi @Jadynut,

What is shown when you access the “username”, “first_name”, and “last_name” parameters? Does it return the proper information for you?

Brent

Brent,

Here is the full debug information returned by friends.getAll() , as you can see there have no username field:

2013-04-30 10:59:16.707 Corona Simulator[533:f03] Corona Cloud: Friends: [{"_id":“517e28c72bef5a6e6a000006”,“created_at”:“2013-04-29T08:01:11+00:00”,“friend_id”:“517cd8dd2bef5acfc0000001”,“updated_at”:“2013-04-29T08:01:11+00:00”,“user_id”:“517cd8dd2bef5acfc0000001”},{"_id":“517e28d22bef5a6e6a000007”,“created_at”:“2013-04-29T08:01:22+00:00”,“friend_id”:“517e28c72bef5a6e6a000006”,“updated_at”:“2013-04-29T08:01:22+00:00”,“user_id”:“517cd8dd2bef5acfc0000001”}]

Hi,

What you will need to do is use function getProfile( userId ) by passing the ‘user_id’.

Thanks

-Mohamed