Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook Login not working when Facebook app is not installed #1187

Closed
4 tasks done
cjosepha opened this issue Feb 20, 2023 · 2 comments · Fixed by #1188
Closed
4 tasks done

Facebook Login not working when Facebook app is not installed #1187

cjosepha opened this issue Feb 20, 2023 · 2 comments · Fixed by #1188
Labels
state:released Released as stable version

Comments

@cjosepha
Copy link
Contributor

cjosepha commented Feb 20, 2023

New Issue Checklist

Issue Description

When the Facebook app is not installed on the device and the app uses AndroidX fragments 1.5+, the Facebook Login flow is broken and the app login Activity is being recreated on top of the existing login Activity instance. Additionally, after closing the additional Activity, the FacebookCallback.onCancel() method is called regardless the webview login and permission was successful. This makes Parse SDK returning a successful task, but with still no ParseUser logged.

Steps to reproduce

  • Make sure Facebook app is not installed on the device
  • Make sure your app uses AndroidX 1.5+ for fragment/activities. In my case: implementation 'androidx.appcompat:appcompat:1.5.1'
  • Use Parse SDK 4.1.0 with Facebook:
    • implementation "com.github.parse-community.Parse-SDK-Android:facebook:4.1.0"
    • implementation "com.github.parse-community.Parse-SDK-Android:parse:4.1.0"
  • Implement Facebook Login
  • Launch the app and launch Facebook Login by calling ParseFacebookUtils.logInWithReadPermissionsInBackground(...)
  • Enter valid credentials
  • Validate

Actual Outcome

  • Additional login Activity created
  • ParseUser.getCurrentUser() still returns null
  • onActivityResult() is not called
  • ParseFacebookUtils.logInWithReadPermissionsInBackground(...) does not return any task and callback is not called

Expected Outcome

  • onActivityResult() is called
  • ParseFacebookUtils.logInWithReadPermissionsInBackground(...) returns a task with a ParseUser or callback success method is called

Environment

Parse Android SDK

  • SDK version: 4.1.0
  • Operating system version: Android 13

Server

  • Parse Server version: 4.2.0
  • Operating system: Linux/4.17.6
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): AWS

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.4.18
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas

Logs

@parse-github-assistant
Copy link

parse-github-assistant bot commented Feb 20, 2023

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@parseplatformorg
Copy link

🎉 This change has been released in version 4.2.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants