ios - Firebase 创建动态链接在本机 iOS 中不起作用。但是它似乎在android中工作正常
问题描述
我使用以下方法创建了一个动态链接:
var link = new firebase.links.DynamicLink(
"https://freshc.in",
"frendy.page.link",
).android
.setPackageName("in.frendy.app")
.ios.setBundleId("in.freshchat.app");
console.log('link', link); //This is giving the console in both android and ios
firebase
.links()
.createDynamicLink(link)
.then(url => {
console.log('Dynamic Link', url); //This is not working in iOS.
link = "http://" + decodeURIComponent(url);
});
上面的代码在 android 中运行良好,但是当我们转到 iOS 时,它会抛出一个错误:
可能的未处理承诺拒绝(id:0):错误:无法创建动态链接错误:无法在 createErrorFromErrorData 处创建动态链接(blob:http://localhost:8081/e76b670d-7fe9-40cb-b837-aa0d40d85769:2122:17 ) 在 blob: http://localhost:8081/e76b670d-7fe9-40cb-b837-aa0d40d85769:2074:27 在 MessageQueue.__invokeCallback (blob: http://localhost:8081/e76b670d-7fe9-40cb-b837-aa0d40d85769: 2645:18 ) 在 blob: http://localhost:8081/e76b670d-7fe9-40cb-b837-aa0d40d85769:2376:18 在 MessageQueue.__guard (blob: http://localhost:8081/e76b670d-7fe9-40cb-b837 -aa0d40d85769:2549:13 ) 在 MessageQueue.invokeCallbackAndReturnFlushedQueue (blob:http://localhost:8081/e76b670d-7fe9-40cb-b837-aa0d40d85769:2375:14)在http://localhost:8081/debugger-ui/debuggerWorker.js:80:58
另请注意,当我使用应用程序前缀名称从谷歌搜索时,我可以打开应用程序in.freshachat.app://
但我没有得到链接
什么可能导致此问题?
解决方案
好吧好吧,如果有人遇到这个问题,记得在域名中添加“ HTTPS ”:
var link = new firebase.links.DynamicLink(" https://freshc.in ", " https://frendy.page.link ", )
推荐阅读
- node.js - can get('/', function (req, res){}不能调用server
- jquery - jQuery 显示元素在 MVC 中未按预期工作
- ios - 如何在 Swift 的绑定中解开可选值?
- http - 在 TechEmpower 基准测试中,Netty 应用程序不支持 keepalive 连接——这是故意的吗?
- python - Python-属性错误-str'对象没有属性'studentsinTeam'
- python - 我知道 Python 中的生成器维护本地状态。这意味着什么?
- php - 如何根据结帐选项添加自定义注释?
- java - Selenium 如何多次等待具有不同文本的同一个 WebElement
- ios - 尝试在表格视图中配置两个单元格时出现“致命错误:索引超出范围”错误
- kubernetes - 如何访问 kubectl 返回的映射中的键