Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Get games

Roman Kushnarenko edited this page Oct 29, 2014 · 2 revisions

Initialize callback listener:

OnPagesListener onPagesListener = new OnPagesListener() {			
	@Override
	public void onComplete(List<Page> games) {
		Log.i(TAG, "Number of games = " + games.size());
	}

	/* 
	 * You can override other methods here: 
	 * onThinking(), onFail(String reason), onException(Throwable throwable)
	 */		
};

Get games:

mSimpleFacebook.getGames(onPagesListener);

Be specific and get what you need

By using this option, you define the properties you need, and you will get only them. Here, any property is possible to get.

Prepare the properties that you need:

Page.Properties properties = new Page.Properties.Builder()
	.add(Properties.ID)
	.add(Properties.NAME)
	.add(Properties.LINK)
	.build();

Get games:

mSimpleFacebook.getGames(properties, onPagesListener);

Get games of other users

If user's games privacy is defined to public, then, you can access these games, or if person is using your app and also accepted the same permissions:

Get games:

mSimpleFacebook.getGames(profileId, onPagesListener);

Same for properties:

mSimpleFacebook.getGames(profileId, properties, onPagesListener);
Clone this wiki locally