Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Video 使用OAuth将视频上传到Twitter_Video_Upload_Twitter_Oauth - Fatal编程技术网

Video 使用OAuth将视频上传到Twitter

Video 使用OAuth将视频上传到Twitter,video,upload,twitter,oauth,Video,Upload,Twitter,Oauth,我正在开发一个iPhone应用程序,它使用Twitvid库将视频上传到Twitvid。 此库首先使用用户名和密码输入参数对应用程序进行身份验证。然后上传视频。 但是,最近我切换到OAuth身份验证机制,这将导致一个网页,用户可以在其中输入用户名和密码。 因此,我无法在我的应用程序中为上传视频提供用户名和密码的输入字段 有人能帮我解决这个问题吗 感谢和问候, Deepa我想您已经使用了Oauth的sau OAuthTwitterEngineedLegate。然后用SA_OAuthTwitterCo

我正在开发一个iPhone应用程序,它使用Twitvid库将视频上传到Twitvid。 此库首先使用用户名和密码输入参数对应用程序进行身份验证。然后上传视频。 但是,最近我切换到OAuth身份验证机制,这将导致一个网页,用户可以在其中输入用户名和密码。 因此,我无法在我的应用程序中为上传视频提供用户名和密码的输入字段

有人能帮我解决这个问题吗

感谢和问候,
Deepa

我想您已经使用了Oauth的sau OAuthTwitterEngineedLegate。然后用
SA_OAuthTwitterController.m
文件中的现有方法替换下面的方法。我认为这会有帮助

 - (BOOL) webView: (UIWebView *) webView shouldStartLoadWithRequest: (NSURLRequest *) request navigationType: (UIWebViewNavigationType) navigationType {
    NSData              *data = [request HTTPBody];

    char                *raw = data ? (char *) [data bytes] : "";

    if (raw && strstr(raw, "cancel=")) {
        [self denied];
        return NO;
    }
    else if ([[[request URL] absoluteString] isEqualToString:@"http://twitter.com/oauth/authorize"]) {
        NSString *str = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
        NSRange range = [str rangeOfString:@"password"];
        NSLog(@"%d",range.location);
        if (range.location != NSNotFound ) {
            NSString *strPass = [str substringFromIndex:range.location+8];
            NSRange toRang = [strPass rangeOfString:@"&oauth_token="];
            strPass = [strPass substringToIndex:toRang.location];
            NSArray *tempArray = [strPass componentsSeparatedByString:@"="];
            if ([tempArray count]) {
                strPass = [tempArray objectAtIndex:1];
                NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
                [defaults setObject:strPass forKey:@"pass"];
            }
        }
    }
    if (navigationType != UIWebViewNavigationTypeOther) 
        _webView.alpha = 0.1;
    return YES;
}
干杯, 布拉格尼斯