Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23156

Windows: Automatically add required Capabilities to Manifest based on API usage

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 6.0.0
    • Component/s: Windows
    • Labels:
      None
    • Story Points:
      13
    • Sprint:
      2016 Sprint 14 SDK, 2016 Sprint 18 SDK

      Description

      With TIMOB-18995 the user can now define Capabilities, as explained in this guide.

      Just like we do for most of Android and iOS it would be great if we would automatically add the required Capabilities based on API usage. So if you use Ti.Media.showCamera in your code, it would automatically add the microphone and webcam Capabilities.

      Test Case

      var win = Ti.UI.createWindow({ backgroundColor: 'black' }),
          lbl = Ti.UI.createLabel({ top: '5%', left: 5, color: 'white' }),
          btn_a = Ti.UI.createButton({ top: '25%',color: 'white', title: 'showCamera()' }),
          btn_b = Ti.UI.createButton({ top: '35%', color: 'white', title: 'openPhotoGallery()' });
       
      Ti.Geolocation.getCurrentPosition(function (data) {
          if (data.success) {
              lbl.text += 'getCurrentPosition()' + data.coords.latitude + ',' + data.coords.longitude;
          }
      });
      btn_a.addEventListener('click', function () {
          Titanium.Media.showCamera({});
      });
      btn_b.addEventListener('click', function () {
          Titanium.Media.openPhotoGallery({mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]});
      });
       
      win.add(lbl);
      win.add(btn_a);
      win.add(btn_b);
      win.open();
      

      And then build it

      appc ti build -p windows --wp-sdk 10.0 --target wp-device
      

      Expected

      PROJECT_ROOT/build/windows/win10.ARM/Package.appxmanifest

      <Capability Name="internetClient" />
      <uap:Capability Name="picturesLibrary" />
      <DeviceCapability Name="location" />
      <DeviceCapability Name="microphone" />
      <DeviceCapability Name="webcam" />
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                fokkezb Fokke Zandbergen
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code