Closed recurse-id closed 8 years ago
without providing the before, after or limit parameters how many friends does the GET request respond with?
The default limit is 20 users.
Thanks for submitting this, @urvishparikh ! :octocat:
What @magni- mentioned is correct, the API does not return all users at once. Would you mind refactoring the method to be +- (void)getFriendsWithLimit:(NSNumber *)limit beforeUserID:(NSString *)beforeUserID afterUserID:(NSString *)afterUserID completionHandler:(VENGenericRequestCompletionHandler)handler;
? You can find more documentation of the request scheme and API at the link @magni- mentioned (https://developer.venmo.com/docs/endpoints/users). Keep in mind that limit and both user IDs are allowed to be nil. By creating the API this way, we can allow different clients to implement pagination how they see necessary, rather than forcing a style of pagination from within the SDK.
If you'd like help in implementing this, let me know! Cheers.
Thanks for the info eliperkins, magni-, I'll have this modification in soon.
Is there a test account I can use that has more than 20 friends?
Unfortunately, Venmo does not have test accounts. I can help you verify though, as my account has more than 20!
I left a couple of pieces of feedback. Let me know if you'd like help testing after you make those changes.
Give it a test drive!
Eventually we would want to create a completion handler
typedef void (^VENGetFriendsCompletionHandler)(VENFriends response, BOOL success, NSError *error);
VENFriends should have some methods to make a call for the next or previous getFriends request based on pagination.
@eliperkins Did it work?
@eliperkins where can I access the method mentioned above to get a user's friends list?
+- (void)getFriendsWithLimit:(NSNumber )limit beforeUserID:(NSString )beforeUserID afterUserID:(NSString *)afterUserID completionHandler:(VENGenericRequestCompletionHandler)handler;
I can't seem to do that without using the HTTP handler and a GET request
Hi @urvishparikh thanks for this pull-request, and sorry for the delayed response. We’re working on a way better API client for Venmo right now, so we’re no longer actively adding features to this existing SDK. Of course you are more than welcome to add more features in your fork of the project.
Thanks again for your PR and let us know if you have any questions. Thanks! :octocat:
Just a heads up: this doesn't necessarily return all friends, you may have to paginate. See https://developer.venmo.com/docs/endpoints/users