fix(mobile-landing): do not attempt opening download link in new window
Instead let the mobile OS take care of opening the URL in the appropriate application. Without target _blank, iOS 13.2.2 on Chrome will open about:blank and immediately close the tab instead of opening the store.
This commit is contained in:
parent
5c1c022291
commit
17c1f50fc3
|
@ -94,6 +94,23 @@ class DeepLinkingMobilePage extends Component<Props> {
|
||||||
const downloadButtonClassName
|
const downloadButtonClassName
|
||||||
= `${_SNS}__button ${_SNS}__button_primary`;
|
= `${_SNS}__button ${_SNS}__button_primary`;
|
||||||
|
|
||||||
|
|
||||||
|
const onOpenLinkProperties = _URLS[Platform.OS]
|
||||||
|
? {
|
||||||
|
// When opening a link to the download page, we want to let the
|
||||||
|
// OS itself handle intercepting and opening the appropriate
|
||||||
|
// app store. This avoids potential issues with browsers, such
|
||||||
|
// as iOS Chrome, not opening the store properly.
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
// When falling back to another URL (Firebase) let the page be
|
||||||
|
// opened in a new window. This helps prevent the user getting
|
||||||
|
// trapped in an app-open-cycle where going back to the mobile
|
||||||
|
// browser re-triggers the app-open behavior.
|
||||||
|
target: '_blank',
|
||||||
|
rel: 'noopener noreferrer'
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className = { _SNS }>
|
<div className = { _SNS }>
|
||||||
<div className = 'header'>
|
<div className = 'header'>
|
||||||
|
@ -113,20 +130,18 @@ class DeepLinkingMobilePage extends Component<Props> {
|
||||||
{ t(`${_TNS}.appNotInstalled`, { app: NATIVE_APP_NAME }) }
|
{ t(`${_TNS}.appNotInstalled`, { app: NATIVE_APP_NAME }) }
|
||||||
</p>
|
</p>
|
||||||
<a
|
<a
|
||||||
|
{ ...onOpenLinkProperties }
|
||||||
href = { this._generateDownloadURL() }
|
href = { this._generateDownloadURL() }
|
||||||
onClick = { this._onDownloadApp }
|
onClick = { this._onDownloadApp }>
|
||||||
rel = 'noopener noreferrer'
|
|
||||||
target = '_blank'>
|
|
||||||
<button className = { downloadButtonClassName }>
|
<button className = { downloadButtonClassName }>
|
||||||
{ t(`${_TNS}.downloadApp`) }
|
{ t(`${_TNS}.downloadApp`) }
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
|
{ ...onOpenLinkProperties }
|
||||||
className = { `${_SNS}__href` }
|
className = { `${_SNS}__href` }
|
||||||
href = { generateDeepLinkingURL() }
|
href = { generateDeepLinkingURL() }
|
||||||
onClick = { this._onOpenApp }
|
onClick = { this._onOpenApp }>
|
||||||
rel = 'noopener noreferrer'
|
|
||||||
target = '_blank'>
|
|
||||||
{/* <button className = { `${_SNS}__button` }> */}
|
{/* <button className = { `${_SNS}__button` }> */}
|
||||||
{ t(`${_TNS}.openApp`) }
|
{ t(`${_TNS}.openApp`) }
|
||||||
{/* </button> */}
|
{/* </button> */}
|
||||||
|
|
Loading…
Reference in New Issue