Hi I am trying to add facebook connect to my Android app , I did managed to post on my wall with app but when I downloaded android facebook app and logged in on it but now I cant post on my wall. I am getting this error:
{"error":{"type":"OAuthException","message":"An active access token
must be used to query information about the current user."}}
CODE:
public class FacebookLogin extends Activity {
private static final String APP_API_ID = "080808998-myappId";
Facebook facebook = new Facebook(APP_API_ID);
private AsyncFacebookRunner mAsyncRunner;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mAsyncRunner = new AsyncFacebookRunner(facebook);
SessionStore.restore(facebook, this);
SessionEvents.addAuthListener(new SampleAuthListener());
Log.i("Error", facebook.getAccessToken()+"tokenId");
facebook.dialog(FacebookLogin.this, "feed", new SampleDialogListener());
}
public void postOnWall(String msg) {
try {
Bundle bundle = new Bundle();
bundle.putString("message", msg);
bundle.putString("from", "fromMe");
bundle.putString("link","facebook.com");
bundle.putString("name","name of the link facebook");
bundle.putString("description","some description here");
//bundle.putString(Facebook.TOKEN, accessToken);
bundle.putString("picture", "http://url to image");
String response = facebook.request("me/feed",bundle,"POST");
Log.d("Error", "got response: " + response);
if (response == null || response.equals("") ||
response.equals("false")) {
Log.v("Error", "Blank response");
}
} catch(Exception e) {
e.printStackTrace();
}
} }
THe token I am getting is null.