Closed nihp closed 4 years ago
Can you share your code please?
I think I have it fixed. Please check the pr
On Sat, Jan 4, 2020, 02:38 Juan David Nicholls Cardona < notifications@github.com> wrote:
Can you share your code please?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/proyecto26/react-native-inappbrowser/issues/131?email_source=notifications&email_token=ABPDZCGHZVSUEZST6YW4YCDQ36AZRA5CNFSM4J7IHZN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIBZGKY#issuecomment-570659627, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPDZCFXJQ3PK6WXLFMDNLTQ36AZRANCNFSM4J7IHZNQ .
Ohh thanks, let me check and publish a new version this weekend 👍
Done! thanks for your help! ❤️
I am getting this on the latest version with just using the example code.
Also I'm getting same error on iPhone 11. But works on iPhone 8. Both are iOS 13.1.
I was also getting the Another InAppBrowser is already being presented error message with the latest version (downloaded 3.3.4
today) when using the example code in an app with React Native 0.60.5
. Tested on the iOS Simulator with iPhone X on iOS 13.3
.
Was able to resolve by:
InAppBrowser.open(url)
without options (omit the 2nd param)💥hopefully that helps a few folks, as I wasted ~45 minutes on this issue
mmm very odd, reopening to have this issue in mind, any pull request is welcome! 👍
I also facing this issue. but unfortunately, the solution from @joshbuchea didn't work for me.
I'm using version v3.3.4
The solution from @joshbuchea didn't work for me :( I'm using version v3.3.4
@prayuditb @claudiozam in what platform? In Android, check if this configuration works for you https://github.com/proyecto26/react-native-inappbrowser/blob/master/example/android/app/src/main/AndroidManifest.xml#L13
One little question, are you using closeAuth
before?
@jdnichollsc in IOS. We are not using closeAuth.
Check the new version 3.4.0
and let me know, or if you can check the follow validation and send a pull request, always is welcome! https://github.com/proyecto26/react-native-inappbrowser/blob/master/index.js#L161
I think we can remove that validation and clear any listener if the openAuth
function is called again, what do you think guys?
After checking in a personal app, this error is happening here https://github.com/proyecto26/react-native-inappbrowser/blob/master/ios/RNInAppBrowser.m#L274
So it looks like safariViewControllerDidFinish
is not working as expected, and I don't understand why
Hello folks! @nihp @frankyjuang @klaaz0r @mstfymrtc @joshbuchea @prayuditb @claudiozam can you help me debugging InAppBrowser
from your apps and let me know if this method is not being called (it's used to clear the promises when the browser is closed)
I can't reproduce this issue from demo project Thanks in advance! 👍
any updates? getting this problem on iOS 13.4, running the emulator. I think I managed to make it work by removing the line modalTransitionStyle: 'partialCurl'
from the demo example.
import { Linking } from 'react-native'
import InAppBrowser from 'react-native-inappbrowser-reborn'
...
async openLink() {
try {
const url = 'https://www.google.com'
if (await InAppBrowser.isAvailable()) {
const result = await InAppBrowser.open(url, {
// iOS Properties
dismissButtonStyle: 'cancel',
preferredBarTintColor: '#453AA4',
preferredControlTintColor: 'white',
readerMode: false,
animated: true,
modalPresentationStyle: 'overFullScreen',
// modalTransitionStyle: 'partialCurl',
modalEnabled: true,
enableBarCollapsing: false,
// Android Properties
showTitle: true,
toolbarColor: '#6200EE',
secondaryToolbarColor: 'black',
enableUrlBarHiding: true,
enableDefaultShare: true,
forceCloseOnRedirection: false,
// Specify full animation resource identifier(package:anim/name)
// or only resource name(in case of animation bundled with app).
animations: {
startEnter: 'slide_in_right',
startExit: 'slide_out_left',
endEnter: 'slide_in_left',
endExit: 'slide_out_right'
},
headers: {
'my-custom-header': 'my custom header value'
}
})
Alert.alert(JSON.stringify(result))
}
else Linking.openURL(url)
} catch (error) {
Alert.alert(error.message)
}
}
...
Don't know if this makes any sense, started with react this year.
@lucasrodes in your case it's ok because you don't need partialCurl transition :)
@jdnichollsc We were able to reproduce the error (Tested on a real device - IPhone X and IPhone 8: IOS 13.5.1)
1- Launch the InAppBrowser by clicking a button. 2- The InAppBrowser pops up. 3- Close the InAppBrowser (by pressing the "Close" button in the top left corner) right after (before the website is rendered). 4- Try to open the InAppBrowser again using the button from step 1. 5- The InAppBrowser pops up for a "milisecond" and gets closed right after automatically without human intervention.
@claudiozam Can you provide a sample app that exhibits this issue? It would be a lot simpler to debug if we had a sample, thanks!
@jdnichollsc the method (void) flowDidFinish is not being called. We think this issue is related with http redirects (301 / 302) and some sync problem.
Saludos y gracias!!!
Do you know if safariViewControllerDidFinish is not being called too?
@jdnichollsc yes the method safariViewControllerDidFinish is not being called too
Also i was able to reproduce the issue in the example app. But it was difficult to test it (No warning all the time...).
I used different URLs. https://bit.ly/2AS3txf https://httpstat.us/301?sleep=1000 https://httpstat.us/302?sleep=1000 https://httpstat.us/301?sleep=5000
Thanks, let me check! 👍
The methods flowDidFinish and safariViewControllerDidFinish are not being called if you are using a modal + InAppBrowser in IOS. You must close the modal and wait a couple of seconds. But I don't know why i was hable to reproduce the message "Another InAppBrowser is already being presented" in the example App. RN Fast Refresh issue?
Are you updating the code while the browser is opened?
No, only before the browser is open and after the user close it
My temporary fix for this issue, is do a try/catch, and then in the catch manually close the browser instance and then re-open it.
await InAppBrowser.close()
InAppBrowser.open(url, config)
A bit of a hack, but the users get a good experience
@jacquesdev 👍 Your are number 1.
Are you updating the code while the browser is opened?
This was indeed my issue: Open the InAppBrowser
, then modify your code, resulting in a refresh. Close the InAppBrowser
, reopen and you get this error. So that's related to reloading the app while the InAppBrowser
is open.
My solution to this is try to not refresh your app while having the InAppBrowser
opened. Once this did happen and you get this error: Kill the app and re-open it. It's not pretty, but it works for me.
I ran into a new scenario, where opening an in app browser twice, the second time it crashes. Nothing really helped me. The await InAppBrowser.close()
didn't help, and also the await InAppBrowser.isAvailable()
didn't help me (always results in true, even when it crashes). The first in app browser is certainly closed before opening the second.
I ended up doing a very ugly hack, something along these lines:
async function open() {
try {
await InAppBrowser.open('...', {});
} catch (error) {
await new Promise((resolve) => setTimeout(resolve, 500));
await InAppBrowser.open('...', {});
}
}
@jdnichollsc @frankyjuang Can we have another look at this issue? These hacks really shouldn't be necessary...
@jdnichollsc @frankyjuang Can we have another look at this issue? These hacks really shouldn't be necessary...
I'm not using this anymore. Sorry cant help
Let me check if I can deploy a new version this weekend, sorry for the delay
I seem to be getting this error when in a case like this: I have a modal (react-native-modal
) where I have a button. When I press the button I close the modal and open the browser, but the closing animation of the modal seems to break the browser. The browser slides up to open but when the modal close animation happens the browser closes too. If I wait for the modal to close before opening the browser everything seems to work all normal.
Works for me after removing modalTransitionStyle: 'partialCurl'
, you should restart your app (not fast refresh) after this change
Please debug the last changes from develop
branch, there's a pending PR of the new version 3.5.0 https://github.com/proyecto26/react-native-inappbrowser/pull/195
I am experiencing the exact same issue as @janpe reported above with the latest version, 3.5.1.
Feel free to attach a repository in order to reproduce this issue and I'll be happy to re-open this issue and take a look 👍
Hello,
I'm facing the same issue using with aws-amplify.
I'm using the following versions:
"react-native": "0.64.1"
"react-native-inappbrowser-reborn": "^3.6.3"
import Amplify from 'aws-amplify'
import { Linking } from 'react-native';
import InAppBrowser from 'react-native-inappbrowser-reborn';
Amplify.configure({
Auth: {
userPoolId: 'COGNITO_USER_POOL_ID',
userPoolWebClientId: 'COGNITO_USER_POOL_WEBCLIENT_ID',
region: 'eu-central-1',
oauth: {
domain: 'auth.myApp',
scope: ['email', 'profile', 'openid',],
redirectSignIn: 'myApp://',
redirectSignOut: 'myApp://',
responseType: 'code',
async urlOpener(url: string, redirectUrl: string) {
const response = await InAppBrowser.openAuth(url, redirectUrl, {
showTitle: false,
enableUrlBarHiding: true,
enableDefaultShare: false,
ephemeralWebSession: false,
});
if (response.type === 'success') await Linking.openURL(response.url);
}
}
},
})
My case trigger the warning:
InAppBrowser.open(url)
My workaround so far that I can getting ride of the warning and open the browser successfully:
InAppBrowser.close()
and InAppBrowser.open(promotionUrl)
.catch()
of InAppBrowser.open(promotionUrl)
let retryCounter = 0;
const openBrowser = () => {
InAppBrowser.close();
InAppBrowser.open(promotionUrl)
.then(() => {
// success handling...
})
.catch(() => {
if (retryCounter < 2) {
setTimeout(() => {
retryCounter++;
openBrowser();
}, 1000);
} else {
// failed handling...
}
});
};
openBrowser();
any update?
I am getting warning as "Another InAppBrowser is already being presented" after the click on the link second time without closing the previously opened window and failed to open the link.
Steps to reproduce:
Note: If I click done in 3rd step means it works well. But here I need will swipe to go back. In this cases how can I make it to work.
I am using react-native version ==> 0.61.5