You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Tim Barham (JIRA)" <ji...@apache.org> on 2016/02/22 14:42:18 UTC

[jira] [Created] (CB-10663) Difficult to add DeviceCapability for plugin so that it works for Win 10 and also 8.1

Tim Barham created CB-10663:
-------------------------------

             Summary: Difficult to add DeviceCapability for plugin so that it works for Win 10 and also 8.1
                 Key: CB-10663
                 URL: https://issues.apache.org/jira/browse/CB-10663
             Project: Apache Cordova
          Issue Type: Bug
          Components: CordovaCommon
            Reporter: Tim Barham
            Assignee: Tim Barham


(windows platform)

When defining device capabilities for a plugin on the Windows platform, the {{m2}} namespace is required when targeting Windows 8.1:

{noformat}
<config-file target="package.appxmanifest" parent="/Package/Capabilities">
    <m2:DeviceCapability Name="bluetooth.genericAttributeProfile" />
</config-file>
{noformat}

However, that namespace isn't valid for the Windows 10 Universal project's {{appxmanifest}} file, where no namespace should be specified for these elements.

It is possible to work around this by using the new {{versions}} attribute added in Cordova 5.0.0:

{noformat}
<config-file target="package.appxmanifest" parent="/Package/Capabilities" versions="<10.0.0">
    <m2:DeviceCapability Name="bluetooth.genericAttributeProfile" />
</config-file>

<config-file target="package.appxmanifest" parent="/Package/Capabilities" versions=">=10.0.0">
    <DeviceCapability Name="bluetooth.genericAttributeProfile" />
</config-file>
{noformat}

However, that becomes very messy and error-prone when there are lots of entries (and will also completely break the build on Cordova versions prior to 5.0.0).

It would be nice if we could somehow handle this automatically (for example, check for the {{m2}} namespace when adding elements to the Windows 10 {{appxmanifest}} and remove it).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org