🌐 AI搜索 & 代理 主页
Skip to content

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

@hw20101101

Description

@hw20101101
 - (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];
                    }];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions