parse-community / ParseFacebookUtils-Android

A utility library to authenticate ParseUsers with the Facebook SDK
http://docs.parseplatform.org/android/guide/#facebook-users
Other
53 stars 63 forks source link

linkWithReadPermissionsInBackground callback is never called #19

Closed natario1 closed 8 years ago

natario1 commented 8 years ago

I am doing something like:

ParseFacebookUtils.linkWithReadPermissionsInBackground(ParseUser.getCurrentUser(),
                getActivity(), permissions, new SaveCallback() {
                    @Override
                    public void done(ParseException e) {
                        if (e != null || !ParseUserUtils.isLinkedWithFacebook()) {
                           App.toast(getActivity(), "Something went wrong!”);
                        } else {
                           App.toast(getActivity(), "Successfully linked”);
                        }
                   }
               });

but done() is never called. I see no toast and my breakpoints are not reached. I have verified through the dashboard (and with subsequent logins) that the user is getting linked, but simply done() is never called. Same with bolts continuations.

At first I thought it was just a very long operation. In that case it would be reasonable to throw a "request timed out” exception after a while. But actually on the dashboard I can see that the operation ends (either successfully or not).

parse-github-bot commented 8 years ago

Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.

Please try the latest SDK. Our release notes have details about what issues were fixed in each release.

In addition, you might find the following resources helpful:

grantland commented 8 years ago

Could you post all relevant bits of your Activity/Fragment?

natario1 commented 8 years ago

@grantland hard to say what’s relevant...? The activity is the main activity of a pretty complete application. The fragment from which I am calling this is just a place where the user can manage its data. I am pretty sure that when the code above is fired nothing else is running.

The code above is fired on clicking a button, which does nothing else. I can wait for minutes but done is not called. If I re-click the button, done is called but I get this exception (which sounds reasonable).

Tell me if I can give you more info.

grantland commented 8 years ago

Relevant bits would be calls to ParseFacebookUtils.onActivityResult(...) as documented here: http://parse.com/docs/android/api/com/parse/ParseFacebookUtils.html

natario1 commented 8 years ago

You are right sir, I was doing something wrong there. Thank you.

sanergulec commented 8 years ago

Hello miav I have the exact same issue, how did you solved it? My code is as below:

                List<String> permissions = Arrays.asList("public_profile", "email", "user_friends");

                System.out.println("I am here 2");

                if (!ParseFacebookUtils.isLinked(ParseUser.getCurrentUser())) {

                    System.out.println("I am here 3");
                    ParseFacebookUtils.linkWithReadPermissionsInBackground(ParseUser.getCurrentUser(), this, permissions, new SaveCallback() {
                        @Override
                        public void done(ParseException ex) {
                            System.out.println("I am here 4");
                            if (ParseFacebookUtils.isLinked(ParseUser.getCurrentUser())) {
                                Log.d("MyApp", "Woohoo, user logged in with Facebook!");

                            }

                            else {

                                Log.e("MyLast", "unexpected error of mine", ex);

                            }

                        }
                    });
                }