App appears twice on “Open with” list after google auth

Hey. Ran into this same issue while using intentFilters as a workaround for another problem related to AuthSession not working in Android standalone: The google login not completed the process in the .apk file but in the Android emulator work fine. · Issue #10860 · expo/expo · GitHub

I was able to prevent the “double app” issue with the following approach:

  1. Add a unique identifier to your intentFilter scheme (I suffixed it with .auth):
      // Workaround for sign in issues
      config.android.intentFilters = [
        {
          action: 'VIEW',
          category: ['BROWSABLE', 'DEFAULT'],
          data: {
            scheme: `${PRODUCTION_BUNDLE_ID}.auth`,
          },
        },
      ];
  1. Modify your makeRedirectUri using your unique scheme (ending with ://) like this:
const redirectUri = AuthSession.makeRedirectUri({
  native: Platform.select({
    /**
     * Workaround for app appearing twice on "Open with" prompt.
     * https://forums.expo.dev/t/app-appears-twice-on-open-with-list-after-google-auth/55659
     */
    android: `${Constants.manifest?.android?.package}.auth://`,
    default: undefined,
  }),
});

In my app, this bypasses the “Open with” prompt and signs in the user. Hope this serves as a good workaround.

1 Like