Facebook SDK – Why onComplete is never run in case of newMeRequest, newGraphPathRequest etc.?

Imagine that you have a code used for retrieval of the user related data from Facebook account, such as:

Request request = Request.newMeRequest(session,
new Request.GraphUserCallback() {
	@Override
	public void onCompleted(GraphUser user, Response response) {
		//Code
	}

request.executeAndWait();

However the onComplete() method is never run. Up till now I have discovered four reasons for such a situation:

  • Request is not executed, i.e. Request.executeAndWait() or Request.executeAsync() are missing
  • Request.executeAsync() is used, however it is not executed on UI thread – Request.executeAndWait() should be used instead. E.g in case of LibGDX the Render() function is NOT executed on the UI thread.
  • The following line of code is missing from the Manifest.xml file
  • <uses-permission android:name="android.permission.INTERNET" />
  • onActivityResult() is not triggering the corresponding function from Facebook SDK, i.e. the following code is missing (uiHelper is of type UiLifecycleHelper which should have been created in onCreate()) :
  • @Override
    
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    	super.onActivityResult(requestCode, resultCode, data); 
    	uiHelper.onActivityResult(requestCode, resultCode, data);
    }

Please let me know if I have missed something!


←Table of contents
←My apps, games and other projects

Advertisements
Facebook SDK – Why onComplete is never run in case of newMeRequest, newGraphPathRequest etc.?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s