title: Facebook iOS Upload Video "Unable to retrieve session key from the access token."
body: <p>I want to upload video on facebook using ios-sdk</p>
  <p>I check discussion in question <a href="https://stackoverflow.com/questions/5355846">iPhone Facebook Video Upload</a> and try to implement it in my application</p>
  <p>I try to your code but not succeed</p>
  <ol>
  <li>I download your code <a href="https://github.com/zoul/facebook-ios-sdk" rel="nofollow noreferrer">https://github.com/zoul/facebook-ios-sdk</a></li>
  <li>take the FBVideoUpload.h/m classes from your src add add into my project</li>
  <li><h1>include &quot;FBVideoUpload.h&quot; in FBConnect.h</h1>
  </li>
  <li>then I code for upload video as follow</li>
  </ol>
  <p>This is Code</p>
  <pre><code>FBVideoUpload *upload = [[FBVideoUpload alloc] init];
  upload.accessToken = facebookObj.accessToken;
  upload.apiKey = fbAppKey;
  upload.appSecret = fbAppSecret;
  NSString *filePath = @&quot;/Users/pratgupta/Library/Application Support/iPhone Simulator/4.1/Media/DCIM/100APPLE/IMG_0010.M4V&quot;;
  NSURL *fileURL = [NSURL fileURLWithPath:filePath];
  NSData *data = [NSData dataWithContentsOfFile:filePath];
  NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                 data, @&quot;&quot;,
                                                 @&quot;test&quot;, @&quot;title&quot;,
                                                 @&quot;upload testing&quot;, @&quot;description&quot;,
                                                 @&quot;EVERYONE&quot;, @&quot;privacy&quot;,
                                                 nil];
  [upload startUploadWithURL:fileURL params:params delegate:self];
  </code></pre>
  <p>But got the error in Logs i.e<br />
  Unable to retrieve session key from the access token.</p>
  <p>which is due to</p>
  <pre><code>if ([self sessionID] == nil) {
          NSLog(@&quot;Unable to retrieve session key from the access token);
          return;
  }
  </code></pre>
  <p>in class FBVideoUpload</p>
  <p>For Login I am using this code</p>
  <pre><code>fbPermissions =  [[NSArray arrayWithObjects:
                         @&quot;read_stream&quot;, @&quot;offline_access&quot;, @&quot;publish_stream&quot;,nil] retain];
  facebookObj = [[Facebook alloc] initWithAppId:fbAppId];
  [facebookObj authorize:fbPermissions delegate:self];
  </code></pre>
  <p>I am able to fetch my updates from facebook so then session is ok here.<br />
  Can you please tell me What wrong I am doing?</p>
  <p><em><strong>EDIT</strong></em><br />
  After changing the login steps suggested by the zoul I am now not getting the sessionID error log.. My request is now sending to the fb server but getting this response</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;error_response xmlns=&quot;http://api.facebook.com/1.0/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd&quot;&gt;
    &lt;error_code&gt;100&lt;/error_code&gt;
    &lt;error_msg&gt;privacy must contains a valid privacy 'value'&lt;/error_msg&gt;
    &lt;request_args list=&quot;true&quot;&gt;
      &lt;arg&gt;
        &lt;key&gt;description&lt;/key&gt;
        &lt;value&gt;upload testing&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;privacy&lt;/key&gt;
        &lt;value&gt;EVERYONE&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;v&lt;/key&gt;
        &lt;value&gt;1.0&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;api_key&lt;/key&gt;
        &lt;value&gt;[here is my API key]&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;method&lt;/key&gt;
        &lt;value&gt;facebook.video.upload&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;session_key&lt;/key&gt;
        &lt;value&gt;c4ada192feb82e8f239a283d-555042146&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;sig&lt;/key&gt;
        &lt;value&gt;8255d4cc3838b278b26fbfc8c86818a3&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;title&lt;/key&gt;
        &lt;value&gt;test&lt;/value&gt;
      &lt;/arg&gt;
    &lt;/request_args&gt;
  &lt;/error_response&gt;
  </code></pre>
  <p><strong>Amit Battan</strong></p>