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

fetchFullProvidersListWithSuccess returns void #90

Open
LetsSee opened this issue Nov 15, 2017 · 4 comments
Open

fetchFullProvidersListWithSuccess returns void #90

LetsSee opened this issue Nov 15, 2017 · 4 comments

Comments

@LetsSee
Copy link

LetsSee commented Nov 15, 2017

Hi!

It would be great if API calls will return NSURLSessionDataTask or array of tasks to give users possibility to control network calls.
E.g:

- (void)fetchFullProvidersListWithSuccess:(void (^)(NSSet* providers))success failure:(SEAPIRequestFailureBlock)failure

will be

- (NSArray*)fetchFullProvidersListWithSuccess:(void (^)(NSSet* providers))success failure:(SEAPIRequestFailureBlock)failure

@nemesis
Copy link
Contributor

nemesis commented Nov 15, 2017

Hi @LetsSee!

It seems I can't think of a good use case when you would need the NSURLSessionDataTask objects, which are managed by the SaltEdge iOS SDK classes. Can you provide further details on why would you need control over the requests?

Thanks

@LetsSee
Copy link
Author

LetsSee commented Nov 15, 2017

Of course:

  1. user initiate some API call on low speed network - loading hud appears - it takes too long and user wants to cancel this operation

  2. consider some long background task - we want to get state in some point (loading, finished, canceling, suspended)

....

@nemesis
Copy link
Contributor

nemesis commented Nov 15, 2017

I see your point, but there are some constraints that will impede this from happening (currently).

The good thing is that you don't actually need the underlying session task objects to solve the two issues you described. The only drawback is that you won't be able to cancel the network operation, and I agree that it's a pity. We will surely consider your feedback when we'll implement a major update, and I'm leaving this issue open until that moment.

@LetsSee
Copy link
Author

LetsSee commented Nov 15, 2017

Thanks, @nemesis!

Please take into account those two issues are just examples, i can imagine much more cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants