Cordova-如何在Windows mobile上获取互动程序标题

Cordova-如何在Windows mobile上获取互动程序标题,cordova,windows-mobile,Cordova,Windows Mobile,我正在使用以下cordova配置从html/js代码创建cordova应用程序: <?xml version='1.0' encoding='utf-8'?> <widget id="myapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>My App</name>

我正在使用以下cordova配置从html/js代码创建cordova应用程序:

<?xml version='1.0' encoding='utf-8'?>
<widget id="myapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>My App</name>
    <description>
        A small demo app
    </description>
    <author email="dont@ask.me" href="http://anyth.ing">
        My App
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-splashscreen" spec="3.2.0"/>
    <access origin="*" />
    <preference name="Fullscreen" value="true"/>
    <platform name="windows">
        <!-- splashs and icons -->

    </platform>
</widget>

我的应用程序
一个小的演示应用程序
我的应用程序
但是,当我将应用程序部署到我的移动设备(Windows 10 mobile)时,“开始”屏幕上的互动程序不显示标题。应用程序列表中的应用程序本身有一个标题,但没有磁贴

如何在startscreen互动程序中获得互动程序标题

问候


Tenoda

据我所知,Cordova没有提供添加Windows互动程序标题的首选项。您可以假设Cordova只接受config.xml中name元素中的名称,并将其用于主屏幕分幅

为了在startscreen互动程序中获取标题,您需要编辑位于platform/windows目录下的package.windows10.appxmanifest

uap:DefaultTile元素下添加以下内容使其适用于我:

<uap:ShowNameOnTiles>
  <uap:ShowOn Tile="square310x310Logo" />
  <uap:ShowOn Tile="square150x150Logo" />
  <uap:ShowOn Tile="wide310x150Logo" />
</uap:DefaultTile>


:在元素uap:DefaultTileShortName属性中添加所需的标题。据我所知,Cordova不提供添加Windows tile标题的首选项。您可以假设Cordova只接受config.xml中name元素中的名称,并将其用于主屏幕分幅

为了在startscreen互动程序中获取标题,您需要编辑位于platform/windows目录下的package.windows10.appxmanifest

uap:DefaultTile元素下添加以下内容使其适用于我:

<uap:ShowNameOnTiles>
  <uap:ShowOn Tile="square310x310Logo" />
  <uap:ShowOn Tile="square150x150Logo" />
  <uap:ShowOn Tile="wide310x150Logo" />
</uap:DefaultTile>


同时:在元素uap:DefaultTileShortName属性中添加所需标题添加到Evertson的答案中:

为了避免继续编辑平台/windows文件,可以将package.windows10.appxmanifest复制到res/native/windows文件夹。代码应该如下所示:

<uap:DefaultTile ShortName="..." Square310x310Logo="..." etc.>
    <uap:ShowNameOnTiles>
        <uap:ShowOn Tile="square310x310Logo" />
        <uap:ShowOn Tile="square150x150Logo" />
        <uap:ShowOn Tile="wide310x150Logo" />
    </uap:ShowNameOnTiles>
</uap:DefaultTile>

如果我删除uap:部分,它会解析并添加,但在构建时当然会失败。

添加到Evertson的答案中:

为了避免继续编辑平台/windows文件,可以将package.windows10.appxmanifest复制到res/native/windows文件夹。代码应该如下所示:

<uap:DefaultTile ShortName="..." Square310x310Logo="..." etc.>
    <uap:ShowNameOnTiles>
        <uap:ShowOn Tile="square310x310Logo" />
        <uap:ShowOn Tile="square150x150Logo" />
        <uap:ShowOn Tile="wide310x150Logo" />
    </uap:ShowNameOnTiles>
</uap:DefaultTile>

如果我删除uap:部分,它会进行解析和添加,但在构建时当然会失败。

我遇到了与插件方法相同的Visual Studio解析问题。我可以通过1)注释掉
块,2)安装插件,3)取消注释
块,4)删除并重新安装插件来实现。诀窍是在整个过程中保持Plugins/Custom选项卡的显示。我还必须删除platforms/windows文件夹并重新构建应用程序。我遇到了与插件方法相同的VisualStudio解析问题。我可以通过1)注释掉
块,2)安装插件,3)取消注释
块,4)删除并重新安装插件来实现。诀窍是在整个过程中保持Plugins/Custom选项卡的显示。我还必须删除platforms/windows文件夹并重建应用程序。
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" 
    id="com.blah.addtiletitleplugin" version="1.0.0">
  <name>Adds the title to windows 10 tiles</name>
  <description>Adds the title to windows 10 tiles</description>
  <platform name="windows">
    <config-file target="package.windows10.appxmanifest" parent="/Package/Applications/Application/uap:VisualElements/uap:DefaultTile/">
      <uap:ShowNameOnTiles>
        <uap:ShowOn Tile="square310x310Logo" />
        <uap:ShowOn Tile="square150x150Logo" />
        <uap:ShowOn Tile="wide310x150Logo" />
      </uap:ShowNameOnTiles>
    </config-file>
  </platform>
</plugin>
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"