Deep links doesnt work when coming from the same website - android

I've already been able to setup deep links (universal links), whenever a link to my site (https://app.example.com) is clicked, it automatically opens the app. If its from slack, messenger or another website. The problem is, if I'm inside app.example.com and I create a link to open app.example.com, it doesn't open the app.
I cant seem to find any documentation to address this problem and I'm not sure if its even allowed, but basically this is the flow that I want to achieve:
(inside app) Click Connect Wearable button
(in browser) Default browser opens wearable's login page
(in browser) Wearable redirects to my own site (https://app.example.com/confirmed)
(in browser) Inside this page is a button that says Return to App [href="https://app.example.com/"]
(inside app) App opens
But as mentioned, step 5 doesn't open the app even if I placed a link-button (as expected on how universal links work), it just redirects within the browser.
Any solution? I need to be able to handle android and iOS, as well as not interfere with PC browsers. If needed, I code using Ionic v6.
Thank you!

As far as I know, this is expected behavior.
The reason is,
Let's say your user actually chose to navigate to your website instead of the application. Since the user is already browsing the website, we can assume the user will keep browsing the website, otherwise, he or she would be inside the app already.
This user might navigate to different pages on your website. If deep links try to send users to the app every time, it would be a terrible UX.
If your intent is to always open the app anyways, using a custom URI scheme is the way to go.

You can try defining custom URI scheme for your apps like "myApp://" and use that inside the button in browser.

Related

App Links inside Custom Tabs in the same app

I am facing a problem where I'm loading some web pages in Custom Tabs, and I want to use App Links when going to a certain page to open the native app. From my investigation, it looks like if the page is open with Custom Tabs in the same application (same package name) as the settings for the App Links, it does not work.
To give you the real life example, I am using Custom Tabs for a "Sign up" flow, letting the user to enter his credentials in a web page, but when going to the next page where it should tell the user to check his email for the confirmation, I want to take the user to the native app, to a custom activity with the Android App Links.
Any suggestions of how to overcome this problem?
Found the problem in my case. If you run into the same problem, check that all your intent filers are verified on the domain.

open chrome custom tab in-app rather than in a window

I'm running into some issues with ChromeCustomTabs, although it might just be a misunderstanding on my end. I have an app where I have the option to open three links, an instagram page, facebook page, and a twitter page. Now, I chose to use custom tabs since it shares credentials with the system and so I won't have to ask the user to login when hitting these pages.
The problem is that facebook and twitter open in a new window, when I really need to get it to open in app where my menus are still available. Is this possible, or is a webview the only way to get a webpage to open in-app?
If this is the case, is there a way to get the links to open without prompting a user if they'd rather launch in chrome or in the native app?
I would like to avoid having to implement a webview with OAuth calls for easy logins if possible.
I tried the simple-chrome-custom-tabs for my project. It could be download from https://github.com/novoda/simple-chrome-custom-tabs. There are many parameters which could be used to customize the UI. Hope it works for you.

Facebook Deep linking for android app

I have a application and i have facebook page for the same.now whenever a user clicks on Use app(call to action) button on android device whether it is facebook android app or user is logged in from browser I need to open my app installed in user's phone.
I have searched so much but came across some old posts as facebook has introduces applinks.org meanwhile.
So I am not getting how to do this thing.
When you're setting up the Call To Action button on your page, you need to select App:
Then you will fill in a URL using your app's custom URL scheme in the Deep Link box (that's what actually launches your app on the visitor's device), and the package name of your app in the Package Name box (I believe Google uses this for verification purposes).
If you haven't set up a custom URL scheme yet, this Facebook docs page explains how. That will take care of opening the app (myApp://), but if you're wanting to go to a specific piece of content (myApp://path/to/content), then you also need to follow these directions.

How can I smartly redirect users who click on an email link, to my app or my mobile site?

I have an app and a mobile site. I also send emails to my users. I would like the following to happen if my users open these emails on their mobile phones and click on a link:
If a user has installed my app, then launch the app and open the relevant page inside it.
If a user has NOT installed my app, then launch the browser and take him to the relevant page on my mobile site.
I want this to happen seamlessly and automatically. I DON'T want to use the inbuilt android prompt as users end up choosing chrome (since it is the first option shown). How can I do this? Would ideally want solutions for both android & ios.
You can do this with a landing page. Send user to landing page, check platform, then check if they have app installed(if they have registered custom url scheme) if they have then they go to app. Otherwise they go to mobilesite.
See this answer by https://stackoverflow.com/a/29019660/1165581 by Adam
You can NOT prevent the Android prompt which lets the user choose an option. What you can do is, create a link to your mobile site and have your App react to urls containing your domain. So what will happen is:
if a user clicks the link and does NOT have your App installed, he/she will be prompted with the default url handler prompt (only the first time) and then open the mobile site in the prefered browser
if a user clicks the link and DOES have your App installed, he/she will get the same prompt, only your App will be listed there as well next to browser Apps.
Here is an explanation on how to this: Android Respond To URL in Intent
You can use URL Schemes in iOS for your requirement to be full filled. By Using URL Scheme you can do exactly same. Clicking on link will launch your app. Please go through the concept of URL Schemes.
Follow the below referral link:
http://code.tutsplus.com/tutorials/ios-sdk-working-with-url-schemes--mobile-6629
Hope this helps!!

Opening and closing an external page in a cordova application

We have a cordova app which needs to run on both iOS and Android. In this app, we need to open a webpage so that the user can login securely and then come back to the app with a generated token. We've looked at the inappbrowser plugin which allows us to open the system browser like this : window.open("http://loginWebsite", "_system"); and then we come back to the app with a custom URI scheme.
My problem with this is the page appears to stay open in the browser after the app is reoppened. On iOS it only leaves the last one open but on android it opens a new tab every single time, leaving them all open.
An alternate solution is to use the inappbrowser like so: window.open("http://loginWebsite", "_blank"); but this appears to give our developper team the possibility to inject code with executeScript in the login or credit card pages we would use. This kind of defeats the purpose of having our login be separate our app.
Are there any solutions or other options ? If possible we would rather have the login be completely separate but having an app leave a bunch of tabs open seems weird.
Thanks

Categories

Resources