【问题标题】:Add the Association Domains feature to your App Id?将关联域功能添加到您的应用程序 ID?
【发布时间】:2018-01-25 14:35:19
【问题描述】:

我正在尝试实现 Firebase 动态链接。

  • 我在 Firebase 控制台上创建了项目并提供了所需的 值(prefx 和 appid)。
  • 我还允许来自开发者控制台的关联域 并成功显示真旗。
  • 在xcode中我有关联域的特性,并添加了url标识符等。

问题:我面临的问题仍然是关联域部分说 将关联域功能添加到您的 App ID。 不知道我收到此错误的原因是什么。 还附上屏幕截图以供证明。

【问题讨论】:

    标签: swift firebase firebase-dynamic-links


    【解决方案1】:

    我找了很久才知道。

    这基本上不是大问题的错误

    “将关联的域功能添加到您的 App ID”

    一旦您在 developer.apple.com 中的 APP ID 中启用关联域,该域就会消失。如果它没有消失,请退出并重新启动 xcode 几次,它就会工作。

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

    【讨论】:

      【解决方案2】:

      我遇到了类似的问题。当我关闭并打开Capabilities 中的功能时,问题就解决了。但是后来我在不同的文件夹中有几个权利文件。将这些文件合二为一的步骤:

      1. 在文本编辑器中打开MY_PROJECT_NAME.xcodeproj\project.pbxproj
      2. 找到CODE_SIGN_ENTITLEMENTS 并设置正确的路径。示例:

      MY_PROJECT_NAME/Entitlements/MY_TARGET_NAME.entitlements

      我不建议使用标准的文本编辑器,因为它会在保存时自动替换文件中的某些字符。

      【讨论】:

        【解决方案3】:

        您需要将关联域添加到您的应用功能。请看截图。添加applinks:yourdomain.com

        然后使用下面的代码获取短网址

        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 ?? "")
        
                }
        

        【讨论】:

          猜你喜欢
          • 2019-11-05
          • 2012-10-31
          • 1970-01-01
          • 2018-11-04
          • 2015-01-24
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多