Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid - Facebook Cancels
    text
    copied!<p>Every time I run my app and it tries to connect to facebook it cancels. It is already authroized and I can connect on my normal Facebook app. I have been looking for a solution for about two days now and can't find any. This is really the only problem holding me back from finishing my app... Hopefully I can get some answers.</p> <p>I am using this <a href="https://github.com/facebook/facebook-android-sdk" rel="nofollow">Facebook SDK</a></p> <p>Here is my facebook authorize code:</p> <pre><code>public void authFB(){ Log.i("IN","FB - Authorizing"); fb.authorize(this, new String[]{ "publish_stream" }, new DialogListener(){ @Override public void onComplete(Bundle values) { SharedPreferences.Editor editor = prefs.edit(); editor.putString("access_token", fb.getAccessToken()); editor.putLong("access_expires", fb.getAccessExpires()); editor.putString("post_id",values.getString("post_id")); editor.commit(); Log.i("IN","Login Successful"); checkFB(); } @Override public void onFacebookError(FacebookError e) { Log.i("IN","Login UnSuccessful - fb error"); e.printStackTrace(); checkFB(); } @Override public void onError(DialogError e) { Log.i("IN","Login UnSuccessful - error"); e.printStackTrace(); checkFB(); } @Override public void onCancel() { Log.i("IN","Login UnSuccessful - cancel"); checkFB(); } }); } </code></pre> <p>Here is my onCreate:</p> <pre><code> super.onCreate(savedInstanceState); setContentView(R.layout.main); prefs = getPreferences(MODE_PRIVATE); String access_token = prefs.getString("access_token", null); //String post_id = prefs.getString("post_id",null); long expires = prefs.getLong("access_expires",0); if(access_token != null){ fb.setAccessToken(access_token); } if(expires != 0){ fb.setAccessExpires(expires); } if(!fb.isSessionValid()){ authFB(); } </code></pre> <p>I have ZERO ideas about what is wrong. I have tried it on two different phones now and this is the debug I get:</p> <pre><code>03-07 18:18:43.460: INFO/IN(6741): Login UnSuccessful - cancel </code></pre> <p>That means onCancel is being called.</p> <p>CONFUSED.</p> <p>Thanks.</p>
 

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