You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web - Safari - Request money - Not redirected to paypal.me when clicking pay with paypal CTA #3615
Hmm, it's really weird that Linking.openURL is not working as expected on safari. If that's the case is there any chance you can investigate and fix this upstream in react-native-web. Then we wouldn't need a hacky fix in e.cash.
Activity
MelvinBot commentedon Jun 16, 2021
Triggered auto assignment to @AndrewGable (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.MelvinBot commentedon Jun 16, 2021
Triggered auto assignment to @marklouisdeshaun (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.MelvinBot commentedon Jun 16, 2021
Triggered auto assignment to @chiragsalian (
Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.rushatgabhane commentedon Jun 17, 2021
Hi! After some digging, I understood what the problem is. Will need your input for the proposal.
The problem
Safari blocks any call to Linking.openURL() (or any way to open new tab)
made inside an async.
I think it's for blocking popups.
https://github.com/Expensify/Expensify.cash/blob/d9fb50e12efcd3bf74909d69accc2308b0f8e999/src/libs/actions/IOU.js#L215-L216
Proposal
Here is a workaround that I found to be working.
If browser is Safari, open a new empty tab using
window.open()and store it's reference.As shown here.
https://github.com/rushatgabhane/Expensify.cash/blob/1fff2aa967b88ec099e8df459e36945b302c28b0/src/libs/actions/IOU.js#L186-L189
On status 200, set the empty tab's url to paypal url.
https://github.com/rushatgabhane/Expensify.cash/blob/1fff2aa967b88ec099e8df459e36945b302c28b0/src/libs/actions/IOU.js#L211-L216
On error, close the empty tab.
https://github.com/rushatgabhane/Expensify.cash/blob/1fff2aa967b88ec099e8df459e36945b302c28b0/src/libs/actions/IOU.js#L221-L225
I tested this on iOS Safari, and it works.
I need help with detecting if the browser is Safari.
chiragsalian commentedon Jun 18, 2021
Hmm, it's really weird that
Linking.openURLis not working as expected on safari. If that's the case is there any chance you can investigate and fix this upstream inreact-native-web. Then we wouldn't need a hacky fix in e.cash.rushatgabhane commentedon Jun 18, 2021
@chiragsalian It isn't an issue with Linking.openURL()
Safari blocks any popup opened in an async call.
More info here
https://expensify.slack.com/archives/C01GTK53T8Q/p1623955103415500?thread_ts=1623955103.415500&cid=C01GTK53T8Q
chiragsalian commentedon Jun 18, 2021
Discussing on slack.
1 remaining item
rushatgabhane commentedon Jun 23, 2021
yeah, but I think someone else should work on this task because my wrapper doesn't work :(
anyway, really curious to see the implemetation!
chiragsalian commentedon Jun 24, 2021
@marklouisdeshaun, for context I asked CarlosM if he could work on this issue. So mark could you remove this job posting from Upwork?
marklouisdeshaun commentedon Jun 24, 2021
The posting has been removed.
luacmartins commentedon Aug 19, 2021
Closing issue since PR has already been deployed to production.
esh-g commentedon Feb 11, 2023
Hey @luacmartins,
I can repro on chrome with the latest
stagingversionv1.2.70-1I have made a bug report on slack, please see the video there:
https://expensify.slack.com/archives/C049HHMV9SM/p1676127541250869
luacmartins commentedon Feb 13, 2023
@esh-g it seems like our QA team can't reproduce it. I'd suggest that we keep this discussion in Slack to see if more people come across this issue.