4

I recently downloaded facebook-android-sdk-3.8.0 and begun to develop an example-app with Facebook integration.

I'm following these tutorials on the Facebook Developers page: https://developers.facebook.com/docs/android/scrumptious

I have successfully implemented the first two parts, i.e. "Authenticate" and "Personalize". But now I'm totally stuck on the "Show Friends" tutorial (https://developers.facebook.com/docs/android/scrumptious/show-friends).

Step 2e works good, but from that to step 3c is not.

The problem is that the friends picker is not shown at all. When I touch the "With whom? Select friends" button, the activity is opened and I see the blue bar at the top with the title "Choose Friends" and the Done-button on the right. But the activity is otherwise white, i.e. without the list of friends.

By examining LogCat, I can't recognise any meaningful error or log messages.

I have read the tutorial through sentence by sentence for at least four times and compared to my implementation, and I just can't find the cause of why the friends picker is not shown. Have also tried to google for a cause and solution but without luck.

I would really appreciate if you can identify the problem and help me to solve this, so I can continue with the tutorial :)

Ramon
  • 245
  • 2
  • 4
  • 15
  • I believe the tutorial you linked to was for v1.0 of the Graph API, whereas if you created your app after 04/30/2014, you're now using Graph API v2.0 (and you should get v3.14 of the Android SDK). In Graph API v2.0, you can only get a list of friends who are also using your app. – Ming Li May 08 '14 at 22:20
  • Yes, I created the app 05/07/2014. Do you mean that I should use v3.14 of the Facebook Android SDK in order to be able to complete the tutorial? Because the version I'm using now works with Graph API v2.0, right? But I can't get the list of friends the same way as in this tutorial? – Ramon May 08 '14 at 22:26
  • What I mean is that v2.0 contains some fundamental differences to v1.0 (see https://developers.facebook.com/docs/apps/changelog), and while v3.8 of the SDK might work, it won't work properly for all APIs. – Ming Li May 08 '14 at 22:32
  • Thanks, now I've downloaded v3.14 and will try with that. – Ramon May 08 '14 at 22:40
  • maybe this will be helpful to you check this out http://stackoverflow.com/questions/23543822/facebook-friend-picker-sdk-sample-not-working-android – NoXSaeeD May 16 '14 at 17:18
  • maybe this will be helpful to you check this out http://stackoverflow.com/questions/23543822/facebook-friend-picker-sdk-sample-not-working-android – NoXSaeeD May 16 '14 at 17:18

1 Answers1

0

The resolution is request the permission for LoginButton default. Declarate the public global LoginButton in SplashFragment and setReadPermission(); for example:

private void showFragment(int fragmentIndex, boolean addToBackStack) {
        FragmentTransaction transaction = fm.beginTransaction();
        for (int i = 0; i < fragments.length; i++) {
            if (i == fragmentIndex) {
                transaction.show(fragments[i]);
                if(i==SPLASH){
                    SplashFragment sf=(SplashFragment)fragments[i];      sf.login.setReadPermissions(Arrays.asList("public_profile","user_friends"));
                    //Log.d("TEST","Permission Set");
                }
            } else {
                transaction.hide(fragments[i]);
            }
        }
        if (addToBackStack) {
            transaction.addToBackStack(null);
        }
        transaction.commit();
    }
Jens
  • 67,715
  • 15
  • 98
  • 113
LynX
  • 41
  • 5