Skip to content

open/openAuth won't redirect to the app with Dynamic Link #389

@namluu25

Description

@namluu25

Which platform(s) does your issue occur on?

  • iOS 15.7 real devices
  • Android Emulator Android 12 (API 31)

Please, provide the following version numbers that your issue occurs with:

  • React Native 0.67.1 (tested on 0.70 same error)
  • "react-native-inappbrowser-reborn": "^3.7.0"

The flow i'm working on:

User click on Integrate with Instagram > InAppBrowser opens Instagram OAuth link to grant access > Redirect to Redirect URI set on Facebook Developer (Dynamic link) > Dynamic link redirect back to app with the specific screen

I've tried both open() and openAuth(), both stopped at the Redirect to Dynamic link step and won't let Dynamic link navigate to the app (and close the In App Browser view). When i tried on Chrome/Safari itself it redirected just fine.

Sample code

export const signInInstagram = async () => {
  const url = `https://api.instagram.com/oauth/authorize?client_id=${config.INSTAGRAM_APP_ID}&redirect_uri=${config.INSTAGRAM_REDIRECT_URL}&scope=user_profile,user_media&response_type=code`;
  try {
    if (await InAppBrowser.isAvailable()) {
      InAppBrowser.open(url, {
        // iOS Properties
        ephemeralWebSession: false,
        // Android Properties
        showTitle: false,
        enableUrlBarHiding: true,
        enableDefaultShare: false,
      });
    } else Linking.openURL(url);
  } catch (error) {
    Logger.debug('instagram error: ', error);
  }
};

The ${config.INSTAGRAM_REDIRECT_URL} has a type like: https://abc.com/def. When user triggers that link, it redirect to myapp://def

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions