Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I figured out how to "retrieve" the offline access infinite session key after a lot of hair-splitting, some trial and error &amp; wondering about all the other productive ways I could have spent that time... agree facebook documentation could be a lot better </p> <p>1) If you are using the facebook-java-api.. then take a look at the facebook demo site for "mobile web" on how to format the URL for requesting offline access<br> <a href="http://itsti.me/index.php" rel="nofollow noreferrer">http://itsti.me/index.php</a> </p> <pre><code>&lt;a href="http://www.facebook.com/connect/prompt_permissions.php?api_key=YOUR_API_KEY&amp;ext_perm=publish_stream%2Coffline_access&amp;next=http%3A%2F%2Fmysite%2Ffacebookconnect&amp;cancel=http%3A%2F%2Fmysite%2Fhome&amp;display=wap"&gt;&lt;img alt="Connect" src="http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_light_medium_long.gif" id="fb_login_image"/&gt;&lt;/a&gt; </code></pre> <p>2) As to how get the offline session key from the session..The trick is : when facebook redirects the user to the "next" url right after granting offline access, you should get the facebook session "again"..this new session will have the infinite session key.<br> here is an example for mobile web...you should be able to figure it out for a regular website.The auth_token is used only for mobile web sites.. you may not need it for a regular web site </p> <pre><code>FacebookJsonRestClient fbc = new FacebookJsonRestClient(MY_API_KEY, SECRET, sessionKey); String auth_token = request.getParameter("auth_token"); System.out.println("infinite session kEY = " + fbc.auth_getSession(auth_token)); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload