Linking - addEventListener not fired on Android in development


I’m trying to implement authentication through Itsme in my application. Itsme implements the OpenID Connect protocol. I am testing through the Expo app on Android in development mode, i.e. expo start --tunnel and then scanning the QR code with the Expo app on my Android phone.

The way it works is:

  1. The user clicks on “Create an account” button
  2. A URL to open the itsme authentication app is constructed. This URL looks like The redirect_uri parameter is constructed with Linking.makeUrl.
  3. I execute Linking.openURL with this URL. This opens the itsme app and the user proceeds with the authentication. This works.
  4. The itsme app then sends a 302 request to the redirect URL, which is exp://, along with the authorization code as a parameter.
  5. This re-opens the Expo app with my app inside of it. But I can’t find a way to fetch the URL of the redirect request. I need to get the authorization code parameter to proceed with the authentication flow. I set up a Linking.addEventListener('url') listener in App.js but the callback is never fired.

Any thoughts on why the callback is never fired?

  $ expo diagnostics
  Expo CLI 3.13.8 environment info:
      OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
      Shell: 4.4.20 - /bin/bash
      Node: 12.13.1 - ~/.asdf/installs/nodejs/12.13.1/bin/node
      Yarn: 1.22.4 - /usr/bin/yarn
      npm: 6.12.1 - ~/.asdf/installs/nodejs/12.13.1/bin/npm
      expo: ^36.0.0 => 36.0.2 
      react: 16.9.0 => 16.9.0 
      react-native: => 0.61.4 
      expo-cli: 3.13.8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.