Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the URI scheme of any app for AppLinks/universal linking?

I need to open a third-party app from my react native mobile app. I understand that this is called universal linking on iOS and AppLink on Android.

I have done a lot of research for this, and I have been able to set up a link to the third party app on the app store. Now I just need to get my app to open up the app if the user has it installed. That requires the URI scheme of the other app, though.

My question is, how do I get the URI scheme to this third party app? Rather, how do I get the URI scheme of any app? I know the URI scheme of the twitter app is 'twitter://app', but the app I am trying to link to is way more niche than twitter or other popular apps, so there is no help for this sort of thing online.

Any tips?

like image 779
MARS Avatar asked Dec 22 '22 23:12

MARS


1 Answers

Finding the URL scheme of an iOS app

Due to Apple's tendency for secrecy, it's not easy to find the URL scheme of an iOS app. But it can be done. Here's how I do it, using a Mac app called iMazing.

  1. Launch iMazing, select a connected iOS device, click Apps:

enter image description here

  1. In the footer of the window, click Manage Apps:

enter image description here

  1. Select the app you're interested in , then select Export .IPA menu item. Note: You may need to download the app first.

enter image description here

  1. The saved file will have the .ipa extension. Change the extension to .zip, and unzip the file. You now have a directory with the name matching the app's name.

  2. Assuming "asana" is the app name, open the file "asana/Payload/asana.app/Info.plist" in a text editor, and search for a section that contains "CFBundleURLSchemes". Assuming the app contains CFBundleURLSchemes (they are optional), it should look something like this:

enter image description here

  1. The URL scheme is in the <string>asana</string>, so the complete url scheme in this case is "asana://". Test that the URL launches the app by typing it into iOS Safari browser window. If it works, Safari should display an alert like this:

enter image description here


What About Apps Without CFBundleURLSchemes?

I haven't found a way to launch apps without CFBundleURLSchemes directly, but you can link to the app's page in the App Store, where the user can open the app with the Open button (or Get button if the app is not installed).

You will need to obtain the app page's URL from the App Store:

  1. Open App Store, go to the app's page, click the share icon:

App Store Asana app page

  1. Click Copy Link:

App Store Copy Link

The URL will look like this:

https://apps.apple.com/us/app/asana-organize-tasks-work/id489969512

Clicking on that link in Safari will bring up the app page in the App Store.

like image 137
terrymorse Avatar answered Dec 25 '22 22:12

terrymorse