facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 909 forks source link

Weird animation when opening facebook app via deep linking (Android) #792

Open LauraBeatris opened 3 years ago

LauraBeatris commented 3 years ago

🐛 Bug Report

When the method LoginManager.logInWithPermissions() is executed, and the user has the Facebook app installed on his device, it will open with a weird animation, kinda like if a modal was preparing to appear and then the Facebook app opens right away on another tab.

To Reproduce

Execute LoginManager.logInWithPermissions() with the facebook app installed on your device

Expected Behavior

The weird animation should disappear and the facebook app should open as expected.

Code Example

Function to execute the login:

const handleAuth = useCallback(async () => {
    LoginManager.logInWithPermissions(FACEBOOK_OAUTH_PERMISSIONS)
      .then((result) => {
        if (result.isCancelled) {
          return;
        }

        handleCurrentAccessToken();
      })
      .catch((error) => {
        showSnackbar({ text: error.message, variant: "error" });
      });
  }, [
    showSnackbar,
    handleCurrentAccessToken,
  ]);

strings.xml:

<resources>
    <string name="app_name">The Kitty</string>
    <string name="facebook_app_id">xxxxx</string>
    <string name="fb_login_protocol_scheme">xxxxxx</string>
</resources>

AndroidManifest.xml

  <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
      <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
    </application>

    <uses-permission android:name="android.permission.INTERNET"/>

    <provider
      android:authorities="com.facebook.app.FacebookContentProviderxxxxxxx"
      android:name="com.facebook.FacebookContentProvider"
      android:exported="true"
    />

ezgif-6-bef0d7e5cbec

Environment

System: OS: macOS 10.15.6 CPU: (8) x64 Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz Memory: 21.39 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.16.3 - /var/folders/x5/l7p5q9gd5hjdn1z5kgrq5n_m0000gn/T/yarn--1599059826977-0.13479430796011305/node Yarn: 1.22.4 - /var/folders/x5/l7p5q9gd5hjdn1z5kgrq5n_m0000gn/T/yarn--1599059826977-0.13479430796011305/yarn npm: 6.14.4 - ~/.nvm/versions/node/v12.16.3/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: Not Found IDEs: Android Studio: 3.6 AI-192.7142.36.36.6392135 Xcode: 11.6/11E708 - /usr/bin/xcodebuild Languages: Java: 1.8.0_251 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.0 => 0.63.0 npmGlobalPackages: react-native: Not Found ✨ Done in 32.01s.

valerio-fornace commented 3 years ago

Hi! Did you solve this issue?

LauraBeatris commented 3 years ago

Hi! Did you solve this issue?

@vassilmladenov Unfortunately not :(