Cordova iOS Universal links issue - ios

I have cordova app which opens website (www.example.com) within webview. I have added cordova universal links plugin in my app https://www.npmjs.com/package/cordova-universal-links-plugin , followed the complete steps, added apple-app-site-association file at the root of my website www.example.com and it is showing json.
I have created universal link www.example.com/activemember, I added this as link in another website www.example2.com. when I open this www.example2.com in safari and clicks on link, it opens my app and takes me to active member screen within app.
Problem is that I am showing www.example2.com within an iframe of www.example.com which is being shown in webview in cordova app. when I click this link from within Iframe from app itself, it does not opens the specific screen within my app. instead, it opens www.example.com inside the iframe. appreciate if some one can help.

This project is deprecated, but there is a fork with some errors fixed:
https://www.npmjs.com/package/cordova-universal-links-plugin-fixed

As pointed out by #borgees, the linked project is abandoned.
If you are willing to switch from Cordova to Capacitor, Capacitor has support for deep links. This uses Ionic Plugin Deeplinks, which is actively maintained.
Another option for Cordova is the BranchIO Cordova Ionic Phonegap Branch Deep Linking Attribution plugin.

Related

Firebase Dynamic links - when clicked not working in iOS

Im using firebase dynamic link to open the mobile application (If already installed) or to redirect user to Playstore or app store.
In iOS mobile , I pasted the link in notes / messaging apps and while clicking the link it Opens the safari browser and it shows the Preview page. Upon clicking the "Open" button in preview page , it says "Safari cannot open the page because the address is invalid".
Can you please help me with this?
Note : In same iOS device , when I set the default browser to chrome and then clicking the Link opens the app correctly.
Finally I am able to resolve the issue.
The initial step is to create a universal link in Firebase console.
Once the universal link is created , we have to do following changes in XCode:
Enable associated domains under capablities
Include URL types
Must verify your Team ID that you would have provided in firebase console.
Once the universal link setup is completed in Xcode, we can do build and run and check the working of Universal link.
i.e. clicking the link should open the app (provided app is already installed).
and it should not open the safari browser.
If clicking the link opens safari browser , then there is a problem with the Universal link setup.
The below tutorial is very useful:
https://youtu.be/KLBjAg6HvG0

Open iOS application from universal links

I have implemented universal links in my application by uploading "apple-app-site-association" to my server and enabling "associated domains" in my project(by adding applinks). My app opens whenever I click on my server weblink from Safari browser.
1) Its not working on any other browser
2) I need to open my app from other apps as well, i.e. Instagram, Twitter etc.
How can I achieve the above scenarios using universal links. If not, is there any other way of achieving the same.
Not all apps will open universal links in you app. You can read a little more here:
"Pasting a Universal Link directly into the Safari URL field doesn’t cause the app to open automatically. If you do this, you will have to manually pull the website down so that a prompt will appear at the top asking you to open the respective app.
But, if you paste links in Facebook(app), Twitter(app), Mail(app) or even if you go to Facebook on Safari and then click on a universal link, the app opens directly.
Universal links will not works for all the apps in iOS. If you click on a universal link from any of the “BLACK LISTED” apps, it will not open the app. Go to this link to know more.
As in step one, for the first time you will have to manually pull down the website and click “open” to open the link using the respective app. The iOS will “remember” to open the app instead of opening the safari if the universal link with the registered domains are clicked."
https://medium.com/#abhimuralidharan/universal-links-in-ios-79c4ee038272
https://docs.branch.io/pages/deep-linking/universal-links/#appsbrowsers-that-support-universal-links

iOS 9+ Universal Links don't work from Google apps

The company I work for told me to ask the following:
When a universal link is tapped in other apps (native Apple apps, Slack, etc.) our app is opened, but if the same link is tapped in any Google app (Hangouts, Inbox, etc.) the universal link is not opened directly by our app.
We set the Google app to not open links inside it and we don't have Chrome installed on devices where the app was tested.
Does anyone have the same problem? Is there any solution for this?
Unfortunately this is the expected behavior. Universal Links do not work directly from within most Google apps — you need to have the link open a web page containing a button or other link within. That button or link can be a Universal Link, which then opens the app.
Here is more information about where Universal Links currently work and do not work.

How to forcefully load desktop site in iFrame in Cordova App?

I want to forcefully load the Desktop View of any website in Cordova App for iPad. I am trying to loading in both iframe and InappBrowser.
By changing User Agent; I tried several methods to change User Agent but no luck. Any idea on this please? If we change user agent will the Apple reject the app while submitting for App Store?
I saw the option in Safari in iPad for 'request desktop site'. Can we do it programmatically in Cordova? or any option in iFrame for this?
Normally the website is redirecting from the Desktop url to mobile site url. So disable redirection is a solution? If so is there any option for that?
Change the iFrame size to pc desktop size and scale to reduce; I tried this but mostly not working.
or is there any other solution.
Thanks
It was working fine before version 4.0.0 of cordova-ios (Different from cordova version).
To be able to do that again a quick fix can be to remove the ios folder created by the new version and adding the old one:
cordova platform rm ios
cordova platform add ios#3
Hope it helps

How to open mobile webapp link in Safari from native Facebook app on iOS?

Our webapp works nicely inside the Facebook native iOS app. However, we have some links that need to open a new window in mobile Safari rather than opening inside the Facebook (UIWebView?) app. Just a plain HTML <a href="http://site...." target="_blank"> doesn't do it--still opens within the Facebook app (latest version.) Any way to get a plain link or a window.open() to switch to Safari for the page load ?
The web team on my company tried that approach and failed. What we ended up doing was using Facebook deep linking to handle this on our native iOS app.
You can find out more about Facebook deep linking here:
https://developers.facebook.com/docs/ios/link-to-your-native-app-ios-sdk/
It's a great solution if you already have an iOS app.
I hope this helps.

Resources