Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Associated Domains Entitlement For a Flutter App

I need to add Associated Domains Entitlement to my Flutter app, so I can implement App Links. I use the uni_links plugin which works well for Android. I've added a ios/Runner/Runner.entitlements file as described, but it doesn't work. Apple official docs imply that I need to add something to the app via xcode. Problem is, I don't use xcode, rather Android Studio. I believe I need to manually add an entry to info.plist or project.pbxproj which is what I believe xcode does, however I am not sure what.

like image 390
shaharsol Avatar asked Nov 06 '19 19:11

shaharsol


People also ask

What is an Associated domain?

Associated domains provide the underpinning to universal links, a feature that allows an app to present content in place of all or part of its website. Users who don't download the app get the same information in a web browser instead of the native app.


1 Answers

Open the Runner.entitlements file from this path :

ios/Runner/Runner.entitlements

And add the applink you want

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <!-- ... other keys -->
  <key>com.apple.developer.associated-domains</key>
  <array>
    <string>applinks:[YOUR_HOST]</string>
  </array>
  <!-- ... other keys -->
</dict>
</plist>

For more information, read Apple's guide for Universal Links.

like image 98
Sumeet.Jain Avatar answered Sep 19 '22 15:09

Sumeet.Jain