I am following this tutorial step by step for making deep linking on Android. Part of the code is as follows, basically it will open the url in my App's webview.
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
if (data != null) {
String path = data.getPath();
String query = data.getEncodedQuery();
String hash = data.getEncodedFragment();
String fullPath = path;
if(query != null){
fullPath = path + "?" + query;
if(hash != null){
fullPath = path + "#" + hash;
}
}
String openUrl = "https://" + Config.domain + fullPath;
....
// and open in webview
}
It almost works perfectly. Links on the Chrome browser can be opened in my app. However, when clicking on links on messaging app such as Whatsapp, the link is opened on Whatsapp itself, by replacing the original content on Whatsapp! And I cannot return to the normal messaging screen of Whatsapp unless I quit the app and open it again!
Why is it behaving like that and what do I have to do to fix it? Thanks!
I had the exact same problem and it was because I had the "launchMode" setted to singleTop. I changed it to singleTask and it worked perfectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With