Project: titanium
Issue TIMOB-23156: Windows: Automatically add required Capabilities to Manifest based on API usage
With TIMOB-18995 the user can now define Capabilities, as explained in [this guide|http://docs.appcelerator.com/platform/latest/#!/guide/tiapp.xml_and_timodule.xml_Reference-section-29004921_tiapp.xmlandtimodule.xmlReference-Windows-specificsection]. 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. h5. Test Case {code} 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(); {code} And then build it {code} appc ti build -p windows --wp-sdk 10.0 --target wp-device {code} h5. Expected PROJECT_ROOT/build/windows/win10.ARM/Package.appxmanifest {code} {code}
Story points: 13