Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20231] Windows: Support handling differing capabilities between Windows 8.1/10

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-01-21T17:25:41.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.3.0
ComponentsWindows
Labelsqe-5.3.0
ReporterChristopher Williams
AssigneeChristopher Williams
Created2016-01-13T20:45:24.000+0000
Updated2016-05-20T18:13:12.000+0000

Description

The list of capabilities specified in the appxmanifest has changed from 8.1 to 10. Some of them apply only to one version or the other, and some of the new ones require the tags be namespaced. Right now our support is basically to allow a passthrough of XML from trap.xml to the manifest to add more capability tags. But I'm not sure if we say use the new <uap:Capability Name="contacts"/> tag for Windows 10, if that will break a build for Windows 8.1. We may need to be smarter to filter out bad values for certain versions. Windows 10: https://msdn.microsoft.com/en-us/library/windows/apps/dn934783.aspx Windows 8.1: https://msdn.microsoft.com/en-us/library/windows/apps/dn423259.aspx Windows Phone 8.1?: https://msdn.microsoft.com/library/windows/apps/hh464936.aspx#domain_credentials

Comments

  1. Christopher Williams 2016-01-13

    Windows 10 requires use of the <uap:Capability Name="contacts"/> tags to get access to contacts APIs.
  2. Kota Iguchi 2016-01-16

    I would do like this, define new properties that specifies target platform and its version:
       <windows>
          <!-- For Windows Phone 8.1 -->
           <manifest target="phone" target_version="8.1">
               <Capabilities>
                   <Capability Name="location" />
               </Capabilities>
           </manifest>
          <!-- For Windows 10 -->
           <manifest target="store" target_version="10.0">
               <Capabilities>
                   <uap:Capability Name="contacts"/>
               </Capabilities>
           </manifest>
          <!-- Common properties across target -->
           <manifest>
               <Capabilities>
                   <Capability Name="internetClient" />
               </Capabilities>
           </manifest>
       </windows>
       
  3. Christopher Williams 2016-01-20

    https://github.com/appcelerator/titanium_mobile_windows/pull/534
  4. Christopher Williams 2016-01-21

    For QE/testing/end users, I took the approach that Kota suggested, with a small tweak to the attribute name, I used "version". So you can specify a version of "8.1" or "10.0", and can specify a target of "phone" or "store". If no target or no version is specified, it's assumed to apply to both possible values for the missing attribute. I also implemented some filtering/handling - if the capability isn't in our whitelist for the platform/version we don't use it. If the capability needs some special namespace for the tag we handle that for you. Just use the non-namespaces <Capability /> tag.
       <windows>
          <!-- For Windows Phone 8.1 -->
           <manifest target="phone" version="8.1">
               <Capabilities>
                   <Capability Name="appointments" />
               </Capabilities>
           </manifest>
         <!-- For Windows Store 8.1 -->
           <manifest target="store" version="8.1">
               <Capabilities>
                   <Capability Name="musicLibrary" />
               </Capabilities>
           </manifest>
          <!-- For Windows 10, Win 10 is universal so target doesn't matter here -->
           <manifest version="10.0">
               <Capabilities>
                   <Capability Name="contacts"/>
               </Capabilities>
           </manifest>
          <!-- Common capabilities across targets and SDK versions, so Win 10, Win 8.1 Store and Win 8.1 Phone -->
           <manifest>
               <Capabilities>
                   <Capability Name="internetClient" />
               </Capabilities>
           </manifest>
       </windows>
       
  5. Harry Bryant 2016-05-20

    Verified as fixed, specifying targets for capabilities will affect only the specified platform. Tested on both 8.1 / 10 with contacts , appointments, location and verified under App Permissions / Privacy settings on device. Tested on: Windows 10 Pro Windows Phone 10.0 & 8.1 (Microsoft Lumia 640 LTE) Appc Studio: 4.6.0.201605030516 Ti SDK: 5.3.0.v20160517124218 Appc NPM: 4.2.5-5 Appc Core: 5.3.0-45 Node: v4.4.4 *Closing Ticket.*

JSON Source