Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added oAuth support to Android. fixes issue #56 error message (An act…

…ive access token must be used to query information about the current user)
  • Loading branch information...
commit 0ef84e29603338930ff82fc6d6ef8525b668077d 1 parent 057e7fd
Tyler Freeman authored March 15, 2012
10  native/android/src/com/phonegap/facebook/ConnectPlugin.java
@@ -159,12 +159,22 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
159 159
     public JSONObject getResponse() {
160 160
         String response = "{"+
161 161
             "\"status\": \""+(facebook.isSessionValid() ? "connected" : "unknown")+"\","+
  162
+            /* old school 
162 163
             "\"session\": {"+
163 164
               "\"access_token\": \""+facebook.getAccessToken()+"\","+
164 165
               "\"expires\": \""+facebook.getAccessExpires()+"\","+
165 166
               "\"session_key\": true,"+
166 167
               "\"sig\": \"...\","+
167 168
               "\"uid\": \""+this.userId+"\""+
  169
+              */
  170
+             //new school: works with oAuth 
  171
+              "\"authResponse\": {"+
  172
+              "\"accessToken\": \""+facebook.getAccessToken()+"\","+
  173
+              "\"expiresIn\": \""+facebook.getAccessExpires()+"\","+
  174
+              "\"session_key\": true,"+
  175
+              "\"sig\": \"...\","+
  176
+              "\"userId\": \""+this.userId+"\""+
  177
+              
168 178
             "}"+
169 179
           "}";
170 180
 

3 notes on commit 0ef84e2

Luis Escobar Bravo

I can confirm that with this mod I can log in with the new Facebook App. I haven't been able to post to my facebook wall yet.

Luis Escobar Bravo

I got to publish to my wall using FB.api instead of FB.iu but this method requires that you grant publish_stream permission to the app (adding pusblis_stream to scope in FB.login)

niravpatel2008

Thank God now FB.api is now working for me otherwise its take my life with active access token required for current user :( :(

Please sign in to comment.
Something went wrong with that request. Please try again.