Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTestUsers implementation to manage paging #76

Merged
merged 6 commits into from
Jan 31, 2015

Conversation

paolobiavati
Copy link
Contributor

new version of method getTestUsers

/**

  • Returns test users associated with a particular app.
  • This method manage paging, call facebook.fetchNext to get next page
  • @param appId the ID of the app
  • @param limit number of elements per page (can be null to use default page size)
  • @return Test Users first page
  • @throws FacebookException when Facebook service or network is unavailable
  • @see Test
    Users - Facebook Developers

    */
    ResponseList getTestUsers(String appId, Integer limit) throws FacebookException;

usage:
ResponseList testUsersResponseList = facebook.getTestUsers(appId, limit);
Paging paging = testUsersResponseList.getPaging();
testUsersResponseList = facebook.fetchNext(paging);

come with test : TestUserMethodsTest.java

age_range comes as part of the public_profile permission, it indicates
unspecific age range that this person's age fits into.
values: min-max: (13-17 / 18-20 / 21-null)

usage:
Facebook facebook = new FacebookFactory().getInstance();
facebook.setOAuthAccessToken(new AccessToken(facebookToken, null));
User me = facebook.getMe(new Reading().fields(new String[]
{“age_range”, "birthday", "email", … }));
new version of  method  getTestUsers

/**
* Returns test users associated with a particular app.
* This method manage paging, call facebook.fetchNext to get next page
* @param appId the ID of the app
* @param limit number of elements per page (can be null to use default
page size)
* @return Test Users first page
* @throws FacebookException when Facebook service or network is
unavailable
* @see <a href="https://developers.facebook.com/docs/test_users/">Test
Users - Facebook Developers</a>
*/
ResponseList<TestUser> getTestUsers(String appId, Integer limit) throws
FacebookException;

usage:
ResponseList<TestUser> testUsersResponseList =
facebook.getTestUsers(appId, limit);
Paging<TestUser> paging = testUsersResponseList.getPaging();
testUsersResponseList = facebook.fetchNext(paging);
This rolls back to commit 2ad97a9.
test for age_range support
new version of  method  getTestUsers
(include test: TestUserMethods)

/**
* Returns test users associated with a particular app.
* This method manage paging, call facebook.fetchNext to get next page
* @param appId the ID of the app
* @param limit number of elements per page (can be null to use default
page size)
* @return Test Users first page
* @throws FacebookException when Facebook service or network is
unavailable
* @see <a href="https://developers.facebook.com/docs/test_users/">Test
Users - Facebook Developers</a>
*/
ResponseList<TestUser> getTestUsers(String appId, Integer limit) throws
FacebookException;

usage:
ResponseList<TestUser> testUsersResponseList =
facebook.getTestUsers(appId, limit);
Paging<TestUser> paging = testUsersResponseList.getPaging();
testUsersResponseList = facebook.fetchNext(paging);
@coveralls
Copy link

Coverage Status

Coverage increased (+0.55%) when pulling 331fb41 on paolobiavati:getTestUsers-paging into 380da68 on roundrop:master.

@roundrop roundrop merged commit 331fb41 into roundrop:master Jan 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants