2013-07-29 26 views

回答

1

我不得不构建我的NSData的视频参数,像这样:

videoData = [NSData dataWithContentsOfURL:url options:NSDataReadingMappedAlways error:&error]; 

我也有在FBRequestConnection.m改变这种方法,事情开始工作:

// 
// Generates a URL for a batch containing only a single request, 
// and names all attachments that need to go in the body of the 
// request. 
// 
// The URL contains all parameters that are not body attachments, 
// including the session key if present. 
// 
// Attachments are named and referenced by name in the URL. 
// 
- (NSString *)urlStringForSingleRequest:(FBRequest *)request forBatch:(BOOL)forBatch 
{ 
    [request.parameters setValue:@"json" forKey:@"format"]; 
    [request.parameters setValue:kSDK forKey:@"sdk"]; 
    NSString *token = request.session.accessTokenData.accessToken; 
    if (token) { 
     [request.parameters setValue:token forKey:kAccessTokenKey]; 
     [self registerTokenToOmitFromLog:token]; 
    } 

    NSString *baseURL; 
    if (request.restMethod) { 
     if (forBatch) { 
      baseURL = [kBatchRestMethodBaseURL stringByAppendingString:request.restMethod]; 
     } else { 
      baseURL = [kRestBaseURL stringByAppendingString:request.restMethod]; 
     } 
    } else { 
     if (forBatch) { 
      baseURL = request.graphPath; 
     } else { 
      NSString *const kVideoGraphBaseURL = @"https://graph-video." FB_BASE_URL @"/"; 
      if (([request.HTTPMethod isEqualToString:@"PUT"] || [request.HTTPMethod isEqualToString:@"POST"]) && [request.graphPath rangeOfString:@"videos"].location != NSNotFound) 
      { 
       baseURL = [kVideoGraphBaseURL stringByAppendingString:request.graphPath]; 
      } 
      else 
      { 
       baseURL = [kGraphBaseURL stringByAppendingString:request.graphPath]; 
      } 
     } 
    } 

    NSString *url = [FBRequest serializeURL:baseURL 
            params:request.parameters 
           httpMethod:request.HTTPMethod]; 
    return url; 
} 

在视频支持iOS SDK似乎很差。

+0

如果我的记忆为我服务,则不能上传超过12兆字节的视频(它是用Facebook技术文档编写的) –

相关问题