Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Add blocks to customize service provider requests. #84

Closed
wants to merge 1 commit into from
Closed

Add blocks to customize service provider requests. #84

wants to merge 1 commit into from

Conversation

larsxschneider
Copy link

With these blocks you can open requests in a UIWebView within app instead of safari.

Example:

AFOAuth1Client *oAuthClient = [[AFOAuth1Client alloc] initWithBaseURL:...];

MyLoginViewController *loginVC = [[MyLoginViewController alloc] init];
[m_rootViewController presentViewController:loginVC animated:NO completion:^(){}];

oAuthClient.onServiceProviderRequest = ^(NSURLRequest *request) {
    [loginVC.webView loadRequest:request];
};

oAuthClient.onServiceProviderRequestFinished = ^() {
    [loginVC dismissViewControllerAnimated:YES completion:nil];
};

[oAuthClient authorizeUsingOAuthWithRequestTokenPath:...];

With these blocks you can open requests in a UIWebView within app instead of safari.

Example:

AFOAuth1Client *oAuthClient = [[AFOAuth1Client alloc] initWithBaseURL:...];

MyLoginViewController *loginVC = [[MyLoginViewController alloc] init];
[m_rootViewController presentViewController:loginVC animated:NO completion:^(){}];

oAuthClient.onServiceProviderRequest = ^(NSURLRequest *request) {
    [loginVC.webView loadRequest:request];
};

oAuthClient.onServiceProviderRequestFinished = ^() {
    [loginVC dismissViewControllerAnimated:YES completion:nil];
};

[oAuthClient authorizeUsingOAuthWithRequestTokenPath:...];
@larsxschneider
Copy link
Author

@mattt Any chance to get this in?

@mattt
Copy link
Contributor

mattt commented Nov 18, 2013

@larsxschneider Thanks for your pull request. It's an interesting feature that I thought would work well with a slightly different implementation. a550861 makes this addition with setServiceProviderRequestHandler:completion:. Let me know what you think.

@mattt mattt closed this Nov 18, 2013
@larsxschneider
Copy link
Author

@mattt Looks good. Thanks for integrating this feature!

.... damn, I wanted onto the contributors list 😜

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

Successfully merging this pull request may close these issues.

None yet

2 participants