Reputation: 745
I've a link like www.mydomain.com/myapp and it is able to deep link to my react native expo app correctly if opened from email or chat. My react app redirects that link to playstore/appstore in case it is opened in desktop.
const MyAppRedirect = (): JSX.Element => {
const userAgent = navigator.userAgent || navigator.vendor;
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
window.location.replace(<appstore link>);
} else {
window.location.replace(<playstore link>);
}
return null;
};
export default MyAppRedirect;
I have another webpage that links to this www.mydomain.com/myapp
<a href="/myapp">Click here</a>
but when opened using Android's Chrome browser or IOS browser, it is not linking to the installed app. I tried this too:
<a href="www.mydomain.com/myapp">Click here</a>
It still doesn't work. Is my only option using the custom scheme? Thanks
Upvotes: 1
Views: 1100