iOS Universal deeplinking without third party app - ios

I am implementing universal deeplinking, I don't want to use any third party framework I have the domain and I have uploaded the apple-app-site association file. Now I want to test if everything is correct or not. How to create the universal link, how to specify ios url scheme and app id in the link ?

Universal Links do not look any different than normal links with your domain. If you registered your AASA at yourdomain.com/apple-app-site-association then yourdomain.com/?example=data should open your app. In the comments you mentioned you want it to open the app store if its not installed. You'll actually need to redirect your link to go to the app store. The Universal Link will not automatically handle that. So yourdomain.com/ will actually need to return a 301 redirect to the app store url. Branch links have that functionality built in if you'd like to save yourself a lot of time.

Related

Is there a way to present users an option for which app to open when multiple apps use the same universal link? [duplicate]

I have two apps under same firebase project, those share the same deep link
How are links handled by the OS if more than one App can use the same universal link? How do I choose the app that is going to be opened to handle certain pages?
for example, both apps share same universal link https://xxx.app.goo.gl
how will it be identified to open user or manager app?
According to Apple, this is dependent on the ordering of your AASA file.
The order of the dictionaries in the array determines the order the system follows when looking for a match, so you can specify an app to handle a particular part of your website.
The app that is listed first in the AASA file will take precedence. You can check that by looking at the AASA endpoint: https://xxx.app.goo.gl/apple-app-site-association
You can also specify certain paths to be handled separately, but if both apps share the same paths then the one listed first in the AASA will open.

iOS: Universal Linking add restrictions

There are 2 Apps in my case say App A and App B.
I want to use universal link to open App B from App A and do some authentication work. I will be sending some result from App B to App A after it completes authentication via App A universal link.
But the use case I am troubled about is I do not want any other app to open App B.
If my HTTPS universal linking URL gets exposed, I know that universal links can not work directly from browser but someone can create malicious app and can try to open the universal link from malicious app.
Is there any solution to that? Like restricting what apps can open App B via universal linking?
Please correct me if my understanding is wrong.
The developer of a malicious app cannot intercept ANY link they want, that's what your apple-app-site-assotiation is for. The connection between the app and the site works both way:
In your app you need to put a domain to your website.
Under <your_domain>/.well-known/apple-app-site-assotiation you've got to put appID and only the app with that specific appID will be eligible to handle URLs to of this domain.
Hope it answers your question.

Link to a specific section of my app, or the app store if it hasn't been downloaded?

I'm in the process of updating my iOS app, and one feature that I'd love to add would be the ability to create links (to send via email, or for social media) that would allow users who have downloaded the app to be taken to a certain section of the app, and users who haven't to be taken to the app store page for my app. I also want it to take desktop users to the itunes page for my app.
Now, I've been looking into url schemes as I think this is the way forward, and have managed to create a custom url scheme that will indeed take users to different parts of my app. However, I'm struggling to find a way to check if the app has been installed, and what device the user is on etc.
Would I need to use a server to redirect them to the correct place?
Thanks!
I found out the best way to do it is with universal links, introduced in iOS 9.
https://blog.branch.io/how-to-setup-universal-links-to-deep-link-on-apple-ios-9/

How to shorten a Firebase Dynamic Link using my own domain name

I'm trying to implement Firebase Dynamic Links in an iOS app. The goal is to have a clean URL for marketing purposes so folks can share links on social media. The idea is folks will share the clean URL that starts with my domain name.
When the app is installed following a click on that link, we want to be able to track who referred the app install by looking at the payload delivered by Firebase. I think this goal is similar to Firebase's use case to convert web users to mobile app users.
An example link I would like to provide for sharing on social media is: http://example.com/my-payload-here
I've tried several cases but I'm not able to get the behavior I'm looking for in any case. Has anyone implemented this successfully before?
Here is my test procedure:
Uninstall the app
Send the link to be tested in an iMessage to myself
Tap the link on my iOS device (not using a simulator)
Install the app from the App Store
Launch the app after download completes by tapping "Open" button in the App Store
Below are my findings:
Short link generated from the Firebase Console (https://xyz.app.goo.gl/ABCD) - Link opens in App Store. I install the app. When I launch the app after installing, the payload is not delivered. If I quit out of the app, go back to the link in iMessage, and launch a second time, the payload is delivered.
Long link identical to the "Long Dynamic Link" from the Firebase console for the link generated in #1 (https://xyz.app.goo.gl/?link=http://example.com/my-payload-here&isi=12345&ibi=com.example.MyApp) - behavior is identical to #1
Short link using my domain (http://example.com/redirect/my-payload-here, configured to 301 redirect to URL in #2) - Opens in App Store. I install. When I launch the app after installing, the payload is not delivered. If I quit out of the app, go back to the link in iMessage, and launch a second time, the link still goes to the App Store.
Some questions I have:
Why isn't the payload delivered on the first launch for cases 1 and 2?
How can we make this launch the app and deliver the payload instead of going to the App Store?
I've also consulted the Firebase flowchart for the deep link in case 2.
Google Firebase team added support for custom subdomains to Dynamic Links.
You can now specify up to five custom page.link subdomains for your Dynamic Links. Short links using these new custom subdomains look like the following example: https://example.page.link/abcXYZ
Firebase Dynamic Link domains assigned on projects couldn't be deleted at this time.( firebase team is working on it.)
You can now whitelist the URL patterns that can be used as a Dynamic Link's deep link (link) or fallback link (ifl, ipfl, afl, ofl). If you define a whitelist, Dynamic Links won't redirect to URLs that don't match a whitelisted pattern.
You can try both of these features in the Firebase console.
This is not currently possible with Firebase. If you need whitelabeled URLs, you either need to build it yourself or use a more powerful link platform like Branch.io (full disclosure: I'm on the Branch team).
To answer your questions specifically:
I have implemented Firebase Dynamic Links in a testbed app and can confirm that linking through installation the first time does work for both long and short URL variants. There is likely something wrong with your AppDelegate config, so we can take a look at that if you want to share code.
Firebase does not support custom domains at this time. In theory (if you can solve the first issue above) you could get this working for first install by using a redirect like you have tried. However, you'll never be able to get it to launch the app with Firebase link data once the app is installed. This is because Universal Links work based on the domain of the link, and don't even request the web destination. Even if you enable Universal Links manually on your own domain, the app will open immediately without ever calling Firebase and the link data will never be set.

Custom URL Scheme and http

Using my iPhone i noticed that when i open a youtube link like http://m.youtube.com/..., this is redirect to the native Youtube app.
I would like to do the same thing but using my custom url scheme, so i would like to have a custom url, if my app is installed in the device this is redirected in it, or if it's not installed, to do something else.
I've tried to register as a custom url scheme the "http://" url scheme, but the is not listening for these urls.
edit-
I've already tried to register my custom url scheme, i want to use an html page, in that page i want to put my custom url scheme, but the problem is that i can't detect, from the web page, if the app is installed in the device
Take a look to the Associated Domains.
If I understand well your question you need to define your own domain that will be associated to your app. Every time an app will find that specific domain the OS will check if any installed app can handle it.
You need to add the capabilities as specified by Apple here
Hope it helps
For that you need to create your custom URL Schema for that you can open via another app.
Following is the Tutorial where you can create your own URL Schema and use into your app.
Here is tutorial.
You can define custom url schemes that will open your app, but you can't make your app the designated handler for certain domain names so that opening that domain in Safari will launch your app automatically.
And One thing for more detail this solution given into this question also.
Happy coding.
You need to add your custom URL schemes in Info.plist. With this schema you can launch your app.

Resources