8

I'm trying to implement Firebase Dynamic Linking.

  • i have created project on firebase console and provided the required value(prefx and appid).
  • i also have allowed the association domains from developer console and it is sucessfully showing true flag.
  • in xcode i have on the feature of association domain and added the url identifiers etc.

Problem: still the problem i'm facing is that Association Domain Section says Add the Association Domains feature to your App ID. don't know whats the reason why i'm getting this error. The screen shot is also attached for prove. enter image description here

Nomi
  • 1,981
  • 2
  • 8
  • 10

3 Answers3

9

i have figured this out by searching for long time.

This is basically not a big issues the error

“Add the associated Domains feature to your App ID”

Will go away once you enable the Associated Domains in your APP ID in developer.apple.com. If it doesn’t go away, quit and relaunch the xcode few times and it will work.

reference: https://medium.com/@abhimuralidharan/universal-links-in-ios-79c4ee038272

Nouman Ch
  • 4,023
  • 4
  • 29
  • 42
  • With Apple engineers being considered amongst the best and paid so rich, quitting and relaunching Xcode as solution definitely is a shame on them!! :D I am getting stuck with this problem just too quite often and frustration level is at the infinity level :D – letsbondiway Oct 06 '22 at 13:22
0

I had a similar problem. The problem was solved when I turned off and turned on the feature in Capabilities. But then I had several entitlements files in different folders. Steps to combine these files into one:

  1. Open in text editor MY_PROJECT_NAME.xcodeproj\project.pbxproj
  2. Find CODE_SIGN_ENTITLEMENTS and set correct path. Example:

"MY_PROJECT_NAME/Entitlements/MY_TARGET_NAME.entitlements"

I do not recommend using a standard text editor, since it can automatically replace some characters in the file while saving.

0

You need to add Associated domains to your App Capabilities. Please see screenshot. Add applinks:yourdomain.com

enter image description here

Then Use below code to get Short URL

guard let link = URL(string: "https://www.yourdomain.com/share_location.html?Id=\(RandomID)&uid=\(uid)") else { return }
        let dynamicLinksDomain = "yourdomain.page.link"


        let components = DynamicLinkComponents(link: link, domain: dynamicLinksDomain)
        // [START shortLinkOptions]
        let options = DynamicLinkComponentsOptions()
        options.pathLength = .unguessable
        components.options = options
        // [END shortLinkOptions]

        // [START shortenLink]
        components.shorten { (shortURL, warnings, error) in
            // Handle shortURL.
            if let error = error {
                print(error.localizedDescription)
                return
            }
            print(shortURL?.absoluteString ?? "")

        }
Yogesh Tandel
  • 1,738
  • 1
  • 19
  • 25