Apple-Touch-Icon部署为Web应用程序



我正在制作一个小的Web应用程序,我希望能够将其保存到手机主屏幕上。目前,我只是一直在尝试将图标用于iPhone上的工作。部署到iPhone时,这不起作用吗?我创建了一个简单的设计,可以用作地点持有人,直到我制作最终图像为止。

这是我的doget:

function **doGet**(request) {
  var html = HtmlService.createTemplateFromFile('HTML')
        .evaluate()
        .addMetaTag('viewport', 'width=device-width, initial-scale=1, 
                    maximum-scale=2.0, user-scalable=yes')
        .addMetaTag('apple-mobile-web-app-capable', 'yes')
        .addMetaTag('mobile-web-app-capable', 'yes')
        .setTitle('....')
        
  return html;
}

和我的html文件的顶部:

<!DOCTYPE html>
<html>
  <head>  
    <link rel="apple-touch-icon.png" href="https://imgur.com/pjRunhf.png" />
    <link rel="apple-touch-icon.png" sizes="57x57" href="https://imgur.com/msEvmfa.png" />
    <link rel="apple-touch-icon" sizes="72x72" href="https://imgur.com/mpyFFCl.png" />
    <link rel="apple-touch-icon" sizes="76x76" href="https://imgur.com/imCLqD7.png" />
    <link rel="apple-touch-icon" sizes="114x114" href="https://imgur.com/p3MpaAR.png" />
    <link rel="apple-touch-icon" sizes="120x120" href="https://imgur.com/s1sXFtn.png" />
    <link rel="apple-touch-icon" sizes="144x144" href="https://imgur.com/OghKpMR.png" />
    <link rel="apple-touch-icon" sizes="152x152" href="https://imgur.com/3aed5Mw.png" />
    <link rel="apple-touch-icon" sizes="180x180" href="https://imgur.com/Zhcnytz.png" /> 

我已经尝试了很多事情,似乎最有用的是将我的元标记移动到我的doget函数中。我还尝试在Doget中使用.setfaviconurl(url(,但是我很难找到一个可以上传.ICO文件的地方。我最终试图将Favicon文件添加到我的Google驱动器中,并使任何人都可以访问该文件,并将该URL用作参数,但不喜欢该链接中没有后缀。有没有办法可以访问带有后缀的Google驱动器文件?像.setFaviconUrl('https://drive.google.com/file/d/someID/view?usp=sharing.ico');一样,我尝试将someID设置为ICO文件所在的文件夹,然后在末尾添加/favicon.ico,但这无效。

添加&quord&amp;格式= png;在您的Google-drive URL的末尾,如下所述:https://stackoverflow.com/a/67393002/20493400

最新更新