Skip to content

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

@cjosepha

Description

@cjosepha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions