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

Thread 1: "-[STTwitterAppOnly postTokenRequest:authenticateInsteadOfAuthorize:forceLogin:screenName:oauthCallback:errorBlock:]: unrecognized selector sent to instance 0x280371140" #294

Open
hw20101101 opened this issue Sep 16, 2020 · 1 comment

Comments

@hw20101101
Copy link

hw20101101 commented Sep 16, 2020

 - (IBAction)loginOnTheWebAction:(id)sender {
      
    self.twitter = [STTwitterAPI twitterAPIAppOnlyWithConsumerKey:_consumerKeyTextField.text consumerSecret:_consumerSecretTextField.text];
 
    _loginStatusLabel.text = @"Trying to login with Safari...";
    _loginStatusLabel.text = @"";
 
    [self.twitter postTokenRequest:^(NSURL *url, NSString *oauthToken) {
        NSLog(@"-- url: %@", url);
        NSLog(@"-- oauthToken: %@", oauthToken);
        
        if([self.openSafariSwitch isOn]) {
            [[UIApplication sharedApplication] openURL:url];
        } else {
            WebViewVC *webViewVC = [self.storyboard instantiateViewControllerWithIdentifier:@"WebViewVC"];
            
            [self presentViewController:webViewVC animated:YES completion:^{
                NSURLRequest *request = [NSURLRequest requestWithURL:url];
                [webViewVC.webView loadRequest:request];
            }];
        }
        
    } authenticateInsteadOfAuthorize:NO
                    forceLogin:@(YES)
                    screenName:nil //scheme://
                 oauthCallback:@"STTwitterDemoIOS://"
                    errorBlock:^(NSError *error) {
                        NSLog(@"-- error: %@", error);
                        _loginStatusLabel.text = [error localizedDescription];
                    }];
}

@fitimdurmishi
Copy link

Any solution for this issue?

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