proyecto26 / react-native-inappbrowser

📱InAppBrowser for React Native (Android & iOS) 🤘
https://www.npmjs.com/package/react-native-inappbrowser-reborn
MIT License
1.33k stars 228 forks source link

Android keeps killing the custom browser tab when the app is inactive #411

Closed namti closed 1 year ago

namti commented 1 year ago

Which platform(s) does your issue occur on?

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

Please, tell us how to recreate the issue in as much detail as possible.

I use openAuth to open the sign-in page. Users need to switch to the email app to get a code then come back to the app to paste the code. When switch back to the app, the opened custom browser tab closed.

Is there any code involved?

InAppBrowser.openAuth('https://auth.example.com', 'exampleapp://auth', {
  // iOS Properties
  ephemeralWebSession: false,
  // Android Properties
  showTitle: false,
  enableUrlBarHiding: true,
  enableDefaultShare: false,
}).then((response) => {
  if (
    response.type === 'success' &&
    response.url
  ) {
    alert(JSON.stringify(response));
  }
})
namti commented 1 year ago

Found the issue. Fixed it by adding showInRecents: true to the options.