无法使用自定义域将Firebase动态链接添加到项目 [英] Unable to add Firebase Dynamic Links to a project using a custom domain

查看:98
本文介绍了无法使用自定义域将Firebase动态链接添加到项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用page.link URL前缀(当时唯一的选项)之前,我已经在其他项目中创建了Firebase动态链接.但是,今天为新项目启用动态链接时,不再显示该选项.看来自定义域的文档已于今天更新.不幸的是,尽管他们提供了一些有用的示例,但并未说明如何以我能理解的方式解决我的问题.

I've created Firebase Dynamic Links in other projects before using the page.link URL prefix (the only option at the time). However that no longer appears to be an option when enabling Dynamic Links for a new project today. It looks like the docs for custom domains were updated today. Unfortunately, while they provide some helpful examples, they don't explain how to resolve my issue in a way that I can understand.

因此,此消息似乎表明我需要在子路径下放置链接".在我看来,在此处添加/link路径前缀应该可以实现这一目标?但是在进行了更改之后,我得到了相同的错误消息.

So this message seems to indicate that I need to "Put links under a subpath". It seems to me that adding the /link path prefix here should accomplish that? But after making that change, I get the same error message.

您似乎已经在此托管站点上提供了内容.将链接放在子路径下,以避免与现有内容冲突.

It looks like you already have content served on this Hosting site. Put links under a subpath to avoid conflicts with existing content.

我想尝试解决此问题,我去了我的项目,并添加了建议的Hosting配置并进行了部署.

I order to try to work around this, I went to my project and added the suggested Hosting configuration and deployed it.

firebase.json:

firebase.json:

{
  "hosting": {
    "public": "dist",
    "ignore": [
      "**/.*"
    ],
    "appAssociation": "AUTO",
    "rewrites": [
      {
        "source": "/link/**",
        "dynamicLinks": true
      },
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

即使等待了一个小时,我仍然收到相同的错误,而且我不知道该怎么办.

Even after waiting an hour, I keep getting the same error and I don't understand what to do.

请注意,由于我在www.devintent.com上托管了Angular单页应用程序,因此我已重写为/index.html.

Note that I have the rewrite to /index.html because I have an Angular Single Page Application hosted at www.devintent.com.

无论我做什么,都会出现此错误,并且Continue按钮保持禁用状态.我尝试使用裸域devintent.com而不是www.devintent.com,但这没有帮助.我尝试使用links.devintent.com,但遇到了相同的错误.

No matter what I do, I keep getting this error and the Continue button stays disabled. I tried using my naked domain devintent.com instead of www.devintent.com, but that didn't help. I tried using links.devintent.com, but got the same error.

如果我从Continue按钮中手动删除disabled,则会收到此错误消息:

If I manually remove disabled from the Continue button, then I get this error message:

这链接到用于手动配置动态链接托管的文档其中有一些我已经完成的步骤.点击Check Again按钮只会使我回到上面第一张图片中的相同错误.

This links to the docs for manually configuring hosting for dynamic links which has some steps that I've already completed. Clicking the Check Again button just takes me back to the same error in the first image above.

不使用自定义域的解决方法

Workaround to not use Custom Domains

我现在很高兴使用page.link链接,我只需要创建一个动态链接并不受阻碍地执行此任务,但是我无法在控制台中找出允许我执行此操作的任何方式要么.

I'm happy at this time to use a page.link link, I just need to create a Dynamic Link and get unblocked on this task, but I can't figure out any way in the console to allow me to do that either.

对此进行更新:我发现我需要将子域添加到page.link URL.工具提示最后会显示或Google提供的免费域(例如,yourapp.page.link)".我本来不希望这样做的突出显示(因为我已经很长时间没有找到它了).对于我来说,现在使用devintent.page.link可以作为一种解决方法.

Update on this: I figured out that I needed to add the subdomain to the page.link URL. The tooltip says "or a free Google-provided domain (for example, yourapp.page.link)" at the end. This is a little less prominent that I would have liked (as I didn't find it for quite a long time). Using devintent.page.link works for me as a workaround for now.

但是,我不确定自定义域配置为何不起作用,如果在具有现有托管配置和自定义域的项目中出现此类复杂情况,为什么我将不使用它作为默认设置.

However, I'm not sure why the Custom Domain configuration didn't work and why it would be the default if there are such complications with projects with existing Hosting configurations and custom domains.

推荐答案

在使自定义域正常运行方面,您所做的一切看起来都是正确的.我想知道您是否正在使用最新版本的firebase-tools(CLI).在版本 6.5.0 中添加了对动态链接的自定义域支持. .

Everything you are doing looks correct with regards to getting your custom domain working. I am wondering if you are using the latest version of firebase-tools (CLI). Custom Domain support for dynamic links was added in version 6.5.0.

好消息是page.link支持仍然存在,但在新的UI流程中并不那么明显.获取page.link域的方法是开始键入所需的子域,并且应该在UI中弹出一个建议.我提供了一个屏幕截图,以显示其工作原理.

Good news is that page.link support still exists but is not as obvious in the new UI flow. The way to get a page.link domain is to start typing your desired subdomain and a suggestion should pop up in the UI. I have included a screenshot to show how this would work.

添加page.link域

希望这会有所帮助,

杰夫

这篇关于无法使用自定义域将Firebase动态链接添加到项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆