code: function (readTypes, writeTypes) {
          var q = $q.defer();
  
          readTypes = readTypes || [
            'HKCharacteristicTypeIdentifierDateOfBirth', 'HKQuantityTypeIdentifierActiveEnergyBurned', 'HKQuantityTypeIdentifierHeight'
          ];
          writeTypes = writeTypes || [
            'HKQuantityTypeIdentifierActiveEnergyBurned', 'HKQuantityTypeIdentifierHeight', 'HKQuantityTypeIdentifierDistanceCycling'
          ];
  
          $window.plugins.healthkit.requestAuthorization({
            'readTypes': readTypes,
            'writeTypes': writeTypes
          }, function (success) {
            q.resolve(success);
          }, function (err) {
            q.reject(err);
          });
  
          return q.promise;
        }
docs: Request authorization to access HealthKit data. See the full HealthKit constants
  reference for possible read and write types:
  https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HealthKit_Constants/