0

I have a problem with Facebook likeview button in my android application. It's using Graph API Level v2.3 now but it will be deprecated at 8 July so i must update it but i dont know how to do it, add that "like" parameter.

I checked out change log it says;

Changes from v2.3 to v2.4

Declarative Fields

To try to improve performance on mobile networks, Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example, GET /v2.4/me/feed no longer includes likes and comments by default, but GET /v2.4/me/feed?fields=comments,likes will return the data. For more details see the docs on how to request specific fields.

In my code likeview setted like this;

likeview.setVisibility(View.VISIBLE);
    likeview.setObjectIdAndType(selectedEvent.xxxxxxweburl, LikeView.ObjectType.DEFAULT);
    likeview.setLikeViewStyle(LikeView.Style.BUTTON);
    likeview.setAuxiliaryViewPosition(LikeView.AuxiliaryViewPosition.INLINE);
    likeview.setHorizontalAlignment(LikeView.HorizontalAlignment.LEFT);

onActivityResult in my Helper class;

public void onActivityResult(int requestCode, int resultCode, Intent data) {
        callbackManager.onActivityResult(requestCode, resultCode, data);
    }

onActivityResult in my ActivityManager class;

@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        facebookHelper.onActivityResult(requestCode, resultCode, data);

        // Check if result comes from the correct activity
        if (requestCode == REQUEST_CODE) {
            AuthenticationResponse response = AuthenticationClient.getResponse(resultCode, data);
            switch (response.getType()) {
                // Response was successful and contains auth token
                case TOKEN:
                    onAuthenticationComplete(response);
                    break;

                // Auth flow returned an error
                case ERROR:
                    logStatus("Auth error: " + response.getError());
                    break;

                // Most likely auth flow was cancelled
                default:
                    logStatus("Auth result: " + response.getType());
            }
        }
    }
Onur
  • 145
  • 2
  • 2
  • 11
  • What you quoted from the changelog is about making API requests, and specifying which data fields you are interested in while doing so. What makes you think that had anything to do with your like view? – CBroe Jun 22 '17 at 07:58
  • I have 3 login types. 1- Email, 2-Facebook, 3-Twitter. When i login just via email and if i click like button on page it can redirect me Facebook SDK's like page so i can like it. But if i can login via Facebook, I cant like it. When i click like button it sets "liked" and turnes quickly "like" cant redirect me Facebook SDK's like page. On change log it says I must add ?fields= paremeter to get likes but i dont know where i should add it. I dont have any get Graph Request Operation to access like. On V2.3 I could do it these codes. – Onur Jun 28 '17 at 07:15

0 Answers0