GithubHelp home page GithubHelp logo

parse-community / parsefacebookutils-android Goto Github PK

View Code? Open in Web Editor NEW
53.0 19.0 63.0 201 KB

A utility library to authenticate ParseUsers with the Facebook SDK

Home Page: http://docs.parseplatform.org/android/guide/#facebook-users

License: Other

Java 100.00%

parsefacebookutils-android's Introduction

[ARCHIVE] Parse Facebook Utils for Android

ParseFacebookUtils has moved to Parse-SDK-Android

Build Status License

A utility library to authenticate ParseUsers with the Facebook SDK. For more information, see our guide.

Dependency

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Then, add the library to your project build.gradle

dependencies {
    implementation 'com.github.parse-community:ParseFacebookUtils-Android:latest.version.here'
}

Usage

Extensive docs can be found in the guide. The basic steps are:

// in Application.onCreate(); or somewhere similar
ParseFacebookUtils.initialize(context);

Within the activity where your user is going to log in with Facebook, include the following:

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

Then elsewhere, when your user taps the login button:

ParseFacebookUtils.logInWithReadPermissionsInBackground(this, permissions, new LogInCallback() {
  @Override
  public void done(ParseUser user, ParseException err) {
    if (user == null) {
      Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
    } else if (user.isNew()) {
      Log.d("MyApp", "User signed up and logged in through Facebook!");
    } else {
      Log.d("MyApp", "User logged in through Facebook!");
    }
  }
});

How Do I Contribute?

We want to make contributing to this project as easy and transparent as possible. Please refer to the Contribution Guidelines.

License

Copyright (c) 2015-present, Parse, LLC.
All rights reserved.

This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.

As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.

parsefacebookutils-android's People

Contributors

acinader avatar badoualy avatar grantland avatar hifileo avatar jawnnypoo avatar kazukinr avatar lacker avatar r21nomi avatar rogerhu avatar stanleyw avatar swami701 avatar tomwfox avatar wangmengyan95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parsefacebookutils-android's Issues

Could anyone please help me with this issues: java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;Lcom/facebook/AccessTokenSource;Ljava/util/Date;Ljava/util/Date;)V in class Lcom/facebook/AccessToken; or its super classes (declaration of 'com.facebook.AccessToken'....

I'm working toward allowing user to login via facebook using parse server, the integration was successful but go this error(below) when user is trying to login in.
Please help

02-11 16:33:14.498 20226-20385/com.xpressoftng.betatutor E/AndroidRuntime: FATAL EXCEPTION: pool-4-thread-8
Process: com.xpressoftng.betatutor, PID: 20226
java.lang.NoSuchMethodError: No direct method (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;Lcom/facebook/AccessTokenSource;Ljava/util/Date;Ljava/util/Date;)V in class Lcom/facebook/AccessToken; or its super classes (declaration of 'com.facebook.AccessToken' appears in /data/app/com.xpressoftng.betatutor-yiEOpIyeFzKdlNn9Dmp8ZA==/split_lib_dependencies_apk.apk)
at com.parse.facebook.FacebookController.setAuthData(FacebookController.java:222)
at com.parse.facebook.ParseFacebookUtils$1.onRestore(ParseFacebookUtils.java:119)
at com.parse.ParseAuthenticationManager$2.call(ParseAuthenticationManager.java:70)
at com.parse.ParseAuthenticationManager$2.call(ParseAuthenticationManager.java:67)
at bolts.Task$4.run(Task.java:357)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

logInWithReadPermissionsInBackground sends out an verification email

Hi,

There's 3 ways to register for my app

  1. via mobile phone (my Parse app sends out a code to the number)
  2. via email address ( my Parse app sends out an verification email that user has to click)
  3. via facebook login

When users registers/logs in using FB account, it sends out a redundant verification email to the users because I fetch user's email from facebook and save it in the "email" column.

I believe this bug has been fixed in the Parse server (do not send out verification email when user logs in using OAuth).
I'm doing exactly the same thing in my iOS version of app and it has the correct behavior (no verification email);
however, using ParseFacebookUtils-Android I keep getting a verification email every time I log in via FB.

Is there a work around?

Much thanks in advance!

Compatibility Issue with Facebook SDK 4.38.0

It appears that FacebookController is using a constructor for AccessToken that no longer exists. It looks like FB wants dataAccessExpirationTime to be passed in now too. According to the Javadocs this new property can be set to null, however I have not looked to see what the consequences of doing that would be.

NOTE: I mention 4.38.0 since that's what the project I'm currently working on uses, but I wouldn't be surprised if this is broken in older versions as well.

Version Deprecation

Hey guys,

I received this notification from FB. I noticed this lib is using the version 4.24 of the FB SDK. Maybe it worths updating it soon ?

Your App, is currently accessing Graph API v2.5 which will reach the end of its 2-year lifetime on 12 April, 2018. To ensure a smooth transition, please migrate all calls to Graph API v2.6 or higher. Use the API Upgrade Tool to understand exactly how this change will impact your app.

Thanks

Facebook Log in error "facebook is not a supported service"

I want to implement a Facebook log in, I was actually using Parse for a few months but I get the "facebook is not a supported service". I followed the Parse guide and I don't know what is going on. Please help!

This is my gradle.build file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.hct.btracker"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 15
        versionName "1.1.5"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile('com.mikepenz:materialdrawer:5.4.0@aar') { transitive = true }

    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:percent:24.2.1'

    //compile 'com.parse:parse-android:1.13.1'
    //compile 'com.parse.bolts:bolts-android:1.3.0'
    compile 'com.parse:parseui-login-android:0.0.1'
    compile 'com.parse:parseui-widget-android:0.0.1'
    compile 'com.parse:parsefacebookutils-v4-android:1.10.4@aar'

    compile 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.github.hotchemi:android-rate:1.0.1'
    compile 'com.github.javiersantos:AppUpdater:2.3'

    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.cleveroad:slidingtutorial:0.9.5'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'joda-time:joda-time:2.9.3'
}

This is my SignupActivity#signInByFacebook :

private void signInByFacebook() {
        if (Utils.isNetworkAvailable(getBaseContext())) {
            //ParseUser parseUser = new ParseUser();

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

            ParseFacebookUtils.logInWithReadPermissionsInBackground(this, permissions, new LogInCallback() {
                @Override
                public void done(ParseUser user, ParseException err) {
                    if (user == null) {
                        Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
                        Log.d("MyAppError", err.getLocalizedMessage());

                    } else if (user.isNew()) {
                        //setResult(RESULT_OK);
                        //finish();
                        getUserDetailFromFB();
                        Log.d("MyApp", "User signed up and logged in through Facebook!");

                        Bundle parameters = new Bundle();
                        parameters.putString(AppEventsConstants.EVENT_PARAM_REGISTRATION_METHOD, "Facebook");
                        logger.logEvent(AppEventsConstants.EVENT_NAME_COMPLETED_REGISTRATION, parameters);

                    } else {
                        Log.d("MyApp", "User logged in through Facebook!");
                    }
                }
            });

        }
    }

I got this is my logcat:

09-21 13:02:29.018 16376-16376/com.hct.btracker D/MyApp: Uh oh. The user cancelled the Facebook login. 09-21 13:02:29.019 16376-16376/com.hct.btracker D/MyAppError: facebook is not a supported service.

ParseFacebookUtils.isLinked is returning true after that link process has failed

The case is the following:

  • I have an facebook ([email protected]) account linked in Parse.
  • With other account (logged with email, [email protected]) I try to link with the first account.
  • isLinked method return false before to try the link proccess.
  • Parse return the error: "this auth is already used"
  • isLinked method now return true, although the process has failed
  • In Parse-server the authData field never is touched (User model)

To restore the correct status of the email account, I have to log out and log in again.

FacebookController.java line 163 crash

Hi.

Since our last app release we are getting an error (see stack below) whenever our users udpate the app. The package version si 1.12.0.

Is anyone else having this issue?

Fatal Exception: java.lang.NoSuchMethodError: No direct method (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;Lcom/facebook/AccessTokenSource;Ljava/util/Date;Ljava/util/Date;)V in class Lcom/facebook/AccessToken; or its super classes (declaration of 'com.facebook.AccessToken' appears in base.apk)
at com.parse.FacebookController.setAuthData(FacebookController.java:163)
at com.parse.ParseFacebookUtils$1.onRestore(ParseFacebookUtils.java:113)
at com.parse.ParseAuthenticationManager$2.call(ParseAuthenticationManager.java:70)
at com.parse.ParseAuthenticationManager$2.call(ParseAuthenticationManager.java:67)
at bolts.Task$4.run(Task.java:357)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

java.lang.NoClassDefFoundError: com.parse.ParseFacebookUtils$1

Android studio 1.5.

line that throws the error -> ParseFacebookUtils.initialize(getApplicationContext());

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile 'com.parse:parsefacebookutils-v4-android:1.10.3@aar'
}

Callback method not getting called in "login with facebook" button click workflow

I copied the code as given in your example to an activity named LoginActivity.
When I click "login with facebook" the facebook popup shows up but on canceling the fb popup it's not even reaching the done method inside callback. However if I click the button again, it reaches there directly with user=null, without even showing the popup this time.

public static final List<String> mPermissions = new ArrayList<String>() {{
    add("public_profile");
    add("email");
}};   
@Bind(R.id.btn_fb_login) Button _mBtnFb;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    ButterKnife.bind(this);

    _mBtnFb.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ParseFacebookUtils.logInWithReadPermissionsInBackground(LoginActivity.this, mPermissions, new LogInCallback() {
                @Override
                public void done(ParseUser user, ParseException err) {
                    Log.d("tag", "Is it reaching here");//On canceling the fb popup it's not even reaching here. However if I click button again, it reaches here directly with user=null, without even showing the popup
                    if (user == null) {
                        Log.d("tag", "Uh oh. The user cancelled the Facebook login.");
                    } else if (user.isNew()) {
                        Log.d("Tag", "User signed up and logged in through Facebook!");
                        getUserDetailsFromFB();
                    } else {
                        Log.d("tag", "User logged in through Facebook!");
                        getUserDetailsFromParse();
                    }
                }
            });

        }
    });
}

The logcat when I click the button for first time is as follows:

12-26 00:49:48.676 10804-10804/com.grafixartist.parseapp I/WebViewFactory: Loading com.android.webview version 39 (eng.buildbot-x86) (code 399997)
12-26 00:49:48.682 10804-10804/com.grafixartist.parseapp I/LibraryLoader: Time to load native libraries: 1 ms (timestamps 9945-9946)
12-26 00:49:48.682 10804-10804/com.grafixartist.parseapp I/LibraryLoader: Expected native library version number "",actual native library version number ""
12-26 00:49:48.688 10804-10804/com.grafixartist.parseapp V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {81ea002}
12-26 00:49:48.688 10804-10804/com.grafixartist.parseapp I/LibraryLoader: Expected native library version number "",actual native library version number ""
12-26 00:49:48.688 10804-10804/com.grafixartist.parseapp I/chromium: [INFO:library_loader_hooks.cc(104)] Chromium logging enabled: level = 0, default verbosity = 0
12-26 00:49:48.692 10804-10804/com.grafixartist.parseapp I/BrowserStartupController: Initializing chromium process, singleProcess=true
12-26 00:49:48.693 10804-10804/com.grafixartist.parseapp W/art: Attempt to remove local handle scope entry from IRT, ignoring
12-26 00:49:48.713 10804-11030/com.grafixartist.parseapp W/AudioManagerAndroid: Requires BLUETOOTH permission
12-26 00:49:48.716 10804-10804/com.grafixartist.parseapp W/chromium: [WARNING:resource_bundle.cc(304)] locale_file_path.empty()
12-26 00:49:48.716 10804-10804/com.grafixartist.parseapp I/chromium: [INFO:aw_browser_main_parts.cc(65)] Load from apk succesful, fd=44 off=46184 len=3037
12-26 00:49:48.716 10804-10804/com.grafixartist.parseapp I/chromium: [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:45 off:229484 len:1089587
12-26 00:49:48.776 10804-10804/com.grafixartist.parseapp W/chromium: [WARNING:mailbox_synchronizer.cc(41)] MailboxSync not supported due to missing EGL image/fence support
12-26 00:49:48.872 10804-10804/com.grafixartist.parseapp W/chromium: [WARNING:data_reduction_proxy_settings.cc(331)] SPDY proxy OFF at startup
12-26 00:49:48.914 10804-10804/com.grafixartist.parseapp W/art: Attempt to remove local handle scope entry from IRT, ignoring
12-26 00:49:48.916 10804-10804/com.grafixartist.parseapp W/AwContents: onDetachedFromWindow called when already detached. Ignoring
12-26 00:49:49.055 10804-10848/com.grafixartist.parseapp W/EGL_emulation: eglSurfaceAttrib not implemented
12-26 00:49:49.056 10804-10848/com.grafixartist.parseapp W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xf3f959a0, error=EGL_SUCCESS
12-26 00:49:49.142 10804-10848/com.grafixartist.parseapp W/EGL_emulation: eglSurfaceAttrib not implemented
12-26 00:49:49.147 10804-10848/com.grafixartist.parseapp W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xf3f95280, error=EGL_SUCCESS
12-26 00:49:49.558 10804-10848/com.grafixartist.parseapp W/EGL_emulation: eglSurfaceAttrib not implemented
12-26 00:49:49.558 10804-10848/com.grafixartist.parseapp W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xf3f57120, error=EGL_SUCCESS
12-26 00:49:51.736 10804-10848/com.grafixartist.parseapp E/chromium: [ERROR:buffer_manager.cc(313)] [.Parent-Compositor-0xce0404e0]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
12-26 00:49:52.087 10804-10804/com.grafixartist.parseapp I/Choreographer: Skipped 33 frames!  The application may be doing too much work on its main thread.
12-26 00:49:52.721 10804-10804/com.grafixartist.parseapp I/Choreographer: Skipped 37 frames!  The application may be doing too much work on its main thread.

Edit:
However if I write entire login code inside main activity it works.
currently login activity is called from main activity like this:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Intent intent = new Intent(this, LoginActivity.class);
    startActivityForResult(intent, successfulLogin);
}

linkWithReadPermissionsInBackground callback is never called

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).

Login into two different apps backed by same Parse server & database.

have two apps (for ex: A and B) live, backed with the Parse Server(now hosted on Heroku).

Both apps point to the same Server App i.e Same parse_app_id and parse_client_key and everything working fine except Login with Facebook.

I have Implemented Facebook login with parsefacebookutils-v4-android in both apps, but the problem is both apps use separate Facebook app i.e facebook_app_id for both apps are different therefore the same Facebook user treat as a separate user in both A &B apps and I want to handle this. So the Facebook login user of An app no needs to be treated as a new user for B app.

In iOS version of my A and B app, it is working perfectly without any extra implementation but not working for Android.

"Cannot modify user" exception occurs in ParseFacebookUtils.initialize

Hi, Developers.

We are using Parse as backend in our app and using ParseFacebookUtils library.
We have a problem that user who logged in via Facebook and Parse for other platform(probably parse-server), can not log in to Android app.

Stack trace is below.

2018-05-16 07:03:09 ERROR  com.parse.ParseRequest$ParseRequestException: Cannot modify user **********.
    at com.parse.ParseRequest.newPermanentException(ParseRequest.java:271)
    at com.parse.ParseRESTCommand.onResponseAsync(ParseRESTCommand.java:301)
    at com.parse.ParseRequest$3.then(ParseRequest.java:137)
    at com.parse.ParseRequest$3.then(ParseRequest.java:133)
    at bolts.i$6.run(Task.java:917)
    at bolts.c$a.execute(BoltsExecutors.java:105)
    at bolts.i.b(Task.java:908)
    at bolts.i.b(Task.java:715)
    at bolts.i.b(Task.java:726)
    at bolts.i$4.then(Task.java:818)
    at bolts.i$4.then(Task.java:806)
    at bolts.i$6.run(Task.java:917)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    at java.lang.Thread.run(Thread.java:761)

We checked this and finally found out the cause of this. In this case, expiration_date of Facebook auth data is invalid format.
FacebookController.java expects PRECISE date format yyyy-MM-dd'T'HH:mm:ss.SSS’Z’, but expiration_date is formatted as IMPRECISE date format yyyy-MM-dd'T'HH:mm:ss’Z’ like 2017-12-28T08:06:56Z.

The user can log in to iOS app, but can not log in to Android app.
I think it’s better the user with IMPRECISE expiration_date can log in to Android app too.

I guess exception occurs at this line.
https://github.com/parse-community/ParseFacebookUtils-Android/blob/v4-1.10.5/library/src/main/java/com/parse/FacebookController.java#L170

If it’s ok, I’ll try to send PR for this.

Thanks.

logInWithPublishPermissions is not returning callback correctly.

Hi, we are using parse as a backend in the app and using ParsefacebookUtils library to integrate facebook in the app.

At the time of login we use ParseFacebookUtils.logInWithReadPermissionsInBackground with permissions like "public_profile", "email", "user_friends", it works fine and allows us to login. However, at certain point of time in the app user can also post on facebook so we are calling

LoginManager.getInstance().logInWithPublishPermissions(this, Arrays.asList("publish_actions"));

If the publish permission is not available to the user. This call is being made from the fragment after which it opens a facebook native dialog to allow the access. after allowing access it comes back to the onActivityResult method of the activity from which we try to redirect that call the onActivityResult method of the fragment.

But the requestcode in the onActivityResult method of activity is not matching with

CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode()
and it's some weird number almost double of what Login requestcode which we use to determine that where the request is coming from, and due to this it's not redirecting to the onActivityResult method of the fragment class.

and even if we bypass that check and calls this directly from onActivityResult method of the fragment class

callbackManager.onActivityResult(requestCode, resultCode, data);

it's not working and granting the publish_actions permission.

Any kind of help would be greatly appreciated.

Note: The app has been also approved for publish_actions on facebook.

I am using the facebook sdk version 4.26

logInWithReadPermissionsInBackground Time out error

Hi everyone,

I've been working on an app for some time using the combination of Parse and Facebook, which uses ParseFacebookUtils, and about a week or so ago I ran into a problem where the dialog box allowing me to log into Facebook either via app or browser stopped showing up. What I get is a long pause where it tries to load the dialog and then it times out.

The error produces the following message: Facebook Signup:: net::ERR_TIMED_OUT

Code is as follows

@Override
public void onClick(View v) {

    Log.d("Facebook Signup:", "Started");

    ParseFacebookUtils.logInWithReadPermissionsInBackground(MainActivity.this, Arrays.asList("public_profile", "email", "user_friends"), new LogInCallback() {

        @Override
        public void done(ParseUser user, ParseException err) {
            if (err == null && user != null) {

                Log.d("Facebook Signup:", "Returned Successfully");

                if (NetworkUtils.isInternetAvailable(MainActivity.this)) {

                    Log.d("Facebook Signup:", "Internet On");

                    getUserDetailsFromFB();
                } else {
                    DialogUtils.showErrorAlert(MainActivity.this, "No Network!", "You are not connected to internet. Please connect and try again.");
                }
            }
            else
            {
                Log.d("Facebook Signup:", err.getMessage());
            }
        }
    });
}

The process starts normally, but never reaches the "Returned Successfully" point of the code, it just goes to the exception which has the time out error. Please note that this was working about 2-3 weeks ago.

I'm using the following versions:
com.facebook.android:facebook-android-sdk:4.27.0
com.parse:parsefacebookutils-v4-android:1.10.5

Thanks for your assistance!

logInWithReadPermissionsInBackground() user = null

Cannot log in when Facebook app is installed on device,
logInWithReadPermissionsInBackground() returns null ParseUser.
However, when debugging I see that authorization is actually successful and I receive facebook token and ID.

Here is the log:

log.txt

NoClassDefFoundError: com.parse.FacebookAuthenticationProvider

logcat

java.lang.NoClassDefFoundError: com.parse.FacebookAuthenticationProvider
                                                   at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:96)
                                                   at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:81)
                                                   at com.test.myapp.MyApp.onCreate(MyApp.java:23)
                                                   at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
                                                   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4769)
                                                   at android.app.ActivityThread.access$1600(ActivityThread.java:179)
                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
                                                   at android.os.Handler.dispatchMessage(Handler.java:102)
                                                   at android.os.Looper.loop(Looper.java:146)
                                                   at android.app.ActivityThread.main(ActivityThread.java:5641)
                                                   at java.lang.reflect.Method.invokeNative(Native Method)
                                                   at java.lang.reflect.Method.invoke(Method.java:515)
                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1288)
                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1104)
                                                   at dalvik.system.NativeStart.main(Native Method)

build.gradle

apply plugin: 'com.android.application'



android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.test.myapp"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"

    multiDexEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
 }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:multidex:1.0.0'
compile project(':volley')
compile 'com.facebook.android:facebook-android-sdk:4.4.0'
compile project(':ParseFacebookUtilsV4-1.9.0')

compile project(':parse-android-1.12.0')

}

MyApp.java

package com.test.myapp;
import android.app.Application;
import android.support.multidex.MultiDex;
import com.facebook.FacebookSdk;
import com.parse.Parse;
import com.parse.ParseFacebookUtils;


public class MyApp extends Application {
@Override
public void onCreate() {
    super.onCreate();
    MultiDex.install(this);
    // Enable Local Datastore.
    Parse.enableLocalDatastore(this);
    Parse.initialize(this);

    FacebookSdk.sdkInitialize(this);
    ParseFacebookUtils.initialize(this);



    }
}

java.lang.NoClassDefFoundError: com.parse.ParseFacebookUtils$1 persistent error

At Issue #12 apparently the solution for this problem was found. But following the instructions i don't find the same result, and the error using ParseFacebookUtils.initialize() continues to throwing the error. Please provides the correct gradle dependencies for solve this problem. I'm using:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile project(':facebook')
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.chrisbanes.photoview:library:1.2.3'
    compile 'com.google.android.gms:play-services-ads:8.3.0'
    compile 'com.parse:parsefacebookutils-v4-android:1.10.4@aar'
    //compile fileTree(dir: 'libs', include: 'Parse-*.jar')

Facebook login error with enablelocaldatastore

Facebook user login doesn't work as expected when I use Parse.enableLocalDatastore, but without Parse.enableLocalDatastore it works perfectly.
I'm currently using com.parse:parse-android:1.11.0 and com.parse:parsefacebookutils-v4-android:1.10.3@aar.
Below is the code i'm trying to execute in production.

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Parse.enableLocalDatastore(this);
        if ( BuildConfig.DEBUG ) {
            Parse.initialize(this, "xx", "xx");
        } else {
            Parse.initialize(this, "xx", "xx");
        }
        ParseConfig.getInBackground();
        ParseUser.enableAutomaticUser();
        ParseInstallation.getCurrentInstallation().saveInBackground();
        ParseFacebookUtils.initialize(this);
    }
}

Failed to resolve: com.github.parse-community:ParseFacebookUtils-Android:1.18.4

App Gradle
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.win.gpsproject"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

ext{
supportLibVer = '27.1.1'

}

dependencies {
implementation fileTree(include: ['.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:$supportLibVer"
implementation "com.android.support:cardview-v7:$supportLibVer"
implementation "com.android.support:design:$supportLibVer"
implementation "com.android.support:support-v4:$supportLibVer"
implementation "com.android.support:support-annotations:$supportLibVer"
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//dagger 2
implementation 'com.google.dagger:dagger:2.17'
annotationProcessor 'com.google.dagger:dagger-compiler:2.17'
implementation 'com.google.dagger:dagger-android-support:2.17'
// if you use the support libraries
//parse
implementation 'com.github.parse-community.Parse-SDK-Android:parse:1.18.4'
implementation 'com.github.parse-community:ParseFacebookUtils-Android:1.18.4'
/
implementation 'com.github.parse-community:ParseFacebookUtils-Android:1.18.4'
implementation 'com.github.parse-community:ParseTwitterUtils-Android:1.18.4'*/
// Butter Knife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}

Project Gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.4'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.