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

Get books

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

Initialize callback listener:

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

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

Get books:

mSimpleFacebook.getBooks(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 books:

mSimpleFacebook.getBooks(properties, onPagesListener);

Get books of other users

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

Get books:

mSimpleFacebook.getBooks(profileId, onPagesListener);

Same for properties:

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