Skip to content

Android App Links not working with react-native-auth0 Expo config plugin #1287

@CodingItWrong

Description

@CodingItWrong

Checklist

Description

The react-native-auth0 Expo config plugin is intended to be able to set up Android App Links, but following the instructions to configure it the App Link URL shows in the web browser instead of redirecting back to the app.

Reproduction

Additional context

I was able to get login working by using the following custom Expo config plugin instead of the official react-native-auth0 Expo config plugin. My custom plugin configures manifest placeholders. As I understand it, though, this shouldn't be necessary:

const { withAppBuildGradle } = require("expo/config-plugins")

const withAuth0 = (config, options) => {
  config = withCustomAppBuildGradle(config, options)
  return config
}

const withCustomAppBuildGradle = (config, options) => {
  return withAppBuildGradle(config, (config) => {
    // Add the manifestPlaceholders to support our app link
    // https://github.com/auth0/react-native-auth0?tab=readme-ov-file#android-1
    config.modResults.contents = config.modResults.contents.replace(
      `minSdkVersion rootProject.ext.minSdkVersion`,
      `manifestPlaceholders = [auth0Domain: "${options.domain}", auth0Scheme: "https"]
          minSdkVersion rootProject.ext.minSdkVersion`,
    )

    return config
  })
}

module.exports = withAuth0

You can try this and see it work in the repro by replacing the "react-native-auth0" plugin with "./withAuth0.js". Video:

react-native-auth0 version

5.0.0-beta.3

React Native version

0.79.2

Expo version

53.0.9

Platform

Android

Platform version(s)

16

Videos

react-native-auth0 plugin, not working custom plugin, working
auth0-plugin.webm
custom-plugin.webm

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions