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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to