Skip to content

Commit

Permalink
Merged original/master. Updated the repo with changes from original r…
Browse files Browse the repository at this point in the history
…epo.
  • Loading branch information
RohanJahagirdar committed Mar 26, 2020
2 parents c7e8ed7 + bcb90d1 commit fb7bf11
Show file tree
Hide file tree
Showing 44 changed files with 8,394 additions and 215 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Xcode
#
build/
Pods
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Changelog

0.8.0v
- Added Support to read Mindfulness data from HealthKit [#139](https://github.com/terrillo/rn-apple-healthkit/pull/139)
- Biological sex permission request [#136](https://github.com/terrillo/rn-apple-healthkit/pull/136)
- Fixed sleep permission request not working [#132](https://github.com/terrillo/rn-apple-healthkit/pull/132)
- Support asking for DateOfBirth permission [#134](https://github.com/terrillo/rn-apple-healthkit/pull/134)
- Fixes URLs in podspec pointing to an invalid repository. [#129](https://github.com/terrillo/rn-apple-healthkit/pull/129)
- Add getDistanceSwimming method [#135](https://github.com/terrillo/rn-apple-healthkit/pull/135)

0.7.2v
- Add query for basalEnergyBurned. [#49](https://github.com/terrillo/rn-apple-healthkit/pull/49)

0.7.1v
- Add TypeScript definition file [#63](https://github.com/terrillo/rn-apple-healthkit/pull/63)
- Fix ios 9 crash [#109](https://github.com/terrillo/rn-apple-healthkit/pull/109)

0.7v
- Added Pods Header in Header Search Path [#101](https://github.com/terrillo/rn-apple-healthkit/pull/101)
- Add podspec for CocoaPods [#96](https://github.com/terrillo/rn-apple-healthkit/pull/96)

0.6.5v
- Enable fetching basal energy [#23](https://github.com/terrillo/rn-apple-healthkit/pull/23)
- remove checkPermission functions in order to use from PR [#69](https://github.com/terrillo/rn-apple-healthkit/pull/69)
- Added correct link to permissions. [#73](https://github.com/terrillo/rn-apple-healthkit/pull/73)
- Add unified way to get workouts + convert Activity Types to name + isTracked flag [#25](https://github.com/terrillo/rn-apple-healthkit/pull/25)

0.6.4v
- Basal energy ([#23](https://github.com/terrillo/rn-apple-healthkit/pull/23))
- Fixed issues with saving weight in the past
- Commited the docs to increase pull request support
- Add daily samples for:
- Flights Climbed
- WalkingRunning Distance
- Cycling Distance

0.6.3v
- Food and Water ([#19](https://github.com/terrillo/rn-apple-healthkit/pull/19))

0.6.1v
- HKQuantityTypeIdentifierActiveEnergyBurned
4 changes: 3 additions & 1 deletion Constants/Permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const Permissions = {
Zinc: "Zinc",
Water: "Water",
DistanceCycling: "DistanceCycling",
DistanceSwimming: "DistanceSwimming",
DistanceWalkingRunning: "DistanceWalkingRunning",
FlightsClimbed: "FlightsClimbed",
HeartRate: "HeartRate",
Expand All @@ -67,5 +68,6 @@ export const Permissions = {
SleepAnalysis: "SleepAnalysis",
StepCount: "StepCount",
Steps: "Steps",
Weight: "Weight"
Weight: "Weight",
Workout: "Workout"
}
10 changes: 10 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'RCTAppleHealthKit' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for RCTAppleHealthKit

end
3 changes: 3 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PODFILE CHECKSUM: 239bd95cf3943e5b4c39aa6e03f66eabb1a7d796

COCOAPODS: 1.8.4
23 changes: 23 additions & 0 deletions RCTAppleHealthKit.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.name = "RCTAppleHealthKit"
s.version = package["version"]
s.summary = package["description"]
s.description = <<-DESC
A React Native package for interacting with Apple HealthKit
DESC
s.homepage = "https://github.com/terrillo/rn-apple-healthkit"
s.license = "MIT"
s.author = { "Terrillo Walls" => "terrillo@terrillo.com" }
s.platforms = { :ios => "9.0" }
s.source = { :git => "https://github.com/terrillo/rn-apple-healthkit.git", :tag => "#{s.version}" }

s.source_files = "RCTAppleHealthKit/**/*.{h,m,swift}"
s.requires_arc = true

s.dependency "React"

end
64 changes: 64 additions & 0 deletions RCTAppleHealthKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
61232F931E303758000A5026 /* RCTAppleHealthKit+Methods_Mindfulness.m in Sources */ = {isa = PBXBuildFile; fileRef = 61232F921E303758000A5026 /* RCTAppleHealthKit+Methods_Mindfulness.m */; };
64C42D4A1D351A8800A0A8F7 /* RCTAppleHealthKit+Methods_Vitals.m in Sources */ = {isa = PBXBuildFile; fileRef = 64C42D491D351A8800A0A8F7 /* RCTAppleHealthKit+Methods_Vitals.m */; };
64E0E73F1D37947B00EAB905 /* RCTAppleHealthKit+Methods_Results.m in Sources */ = {isa = PBXBuildFile; fileRef = 64E0E73E1D37947B00EAB905 /* RCTAppleHealthKit+Methods_Results.m */; };
846A98EA215244E7000C3E5D /* RCTAppleHealthKit+Methods_Dietary.m in Sources */ = {isa = PBXBuildFile; fileRef = 846A98E9215244E6000C3E5D /* RCTAppleHealthKit+Methods_Dietary.m */; };
C7F88CE6A9E2D530A1CBDFAA /* Pods_RCTAppleHealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C84411FDBEEBD8BA9C43C813 /* Pods_RCTAppleHealthKit.framework */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -64,19 +66,25 @@
5559CC0E207391FC004A9342 /* RCTAppleHealthKit+Methods_CDA.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_CDA.m"; sourceTree = "<group>"; };
58C81E6D1F84F6970005DD48 /* RCTAppleHealthKit+Methods_Activity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Activity.m"; sourceTree = "<group>"; };
58C81E6E1F84F6970005DD48 /* RCTAppleHealthKit+Methods_Activity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Activity.h"; sourceTree = "<group>"; };
5ED55FED5925473BC28AF03D /* Pods-RCTAppleHealthKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RCTAppleHealthKit.release.xcconfig"; path = "Target Support Files/Pods-RCTAppleHealthKit/Pods-RCTAppleHealthKit.release.xcconfig"; sourceTree = "<group>"; };
61232F911E303758000A5026 /* RCTAppleHealthKit+Methods_Mindfulness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Mindfulness.h"; sourceTree = "<group>"; };
61232F921E303758000A5026 /* RCTAppleHealthKit+Methods_Mindfulness.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Mindfulness.m"; sourceTree = "<group>"; };
64C42D481D351A8800A0A8F7 /* RCTAppleHealthKit+Methods_Vitals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Vitals.h"; sourceTree = "<group>"; };
64C42D491D351A8800A0A8F7 /* RCTAppleHealthKit+Methods_Vitals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Vitals.m"; sourceTree = "<group>"; };
64E0E73D1D37947B00EAB905 /* RCTAppleHealthKit+Methods_Results.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Results.h"; sourceTree = "<group>"; };
64E0E73E1D37947B00EAB905 /* RCTAppleHealthKit+Methods_Results.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Results.m"; sourceTree = "<group>"; };
846A98E8215244E6000C3E5D /* RCTAppleHealthKit+Methods_Dietary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Dietary.h"; sourceTree = "<group>"; };
846A98E9215244E6000C3E5D /* RCTAppleHealthKit+Methods_Dietary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Dietary.m"; sourceTree = "<group>"; };
AD8403CE6AF2AAD2D7CEE97E /* Pods-RCTAppleHealthKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RCTAppleHealthKit.debug.xcconfig"; path = "Target Support Files/Pods-RCTAppleHealthKit/Pods-RCTAppleHealthKit.debug.xcconfig"; sourceTree = "<group>"; };
C84411FDBEEBD8BA9C43C813 /* Pods_RCTAppleHealthKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RCTAppleHealthKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
3774C88A1D2092F20000B3F3 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C7F88CE6A9E2D530A1CBDFAA /* Pods_RCTAppleHealthKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -88,6 +96,8 @@
children = (
3774C88F1D2092F20000B3F3 /* RCTAppleHealthKit */,
3774C88E1D2092F20000B3F3 /* Products */,
B50D2EA9671519248AFEBEE7 /* Pods */,
BF8F8FA9DB6FF33D400AA73E /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -106,6 +116,8 @@
2AFA717F22139B0E00DF297E /* RCTAppleHealthKit+Methods_CDA.m */,
2A5EDE862208E0E7005D657E /* RCTAppleHealthKit+Methods_ClinicalRecords.h */,
2A5EDE852208E0E7005D657E /* RCTAppleHealthKit+Methods_ClinicalRecords.m */,
846A98E8215244E6000C3E5D /* RCTAppleHealthKit+Methods_Dietary.h */,
846A98E9215244E6000C3E5D /* RCTAppleHealthKit+Methods_Dietary.m */,
58C81E6E1F84F6970005DD48 /* RCTAppleHealthKit+Methods_Activity.h */,
58C81E6D1F84F6970005DD48 /* RCTAppleHealthKit+Methods_Activity.m */,
61232F911E303758000A5026 /* RCTAppleHealthKit+Methods_Mindfulness.h */,
Expand Down Expand Up @@ -136,13 +148,32 @@
path = RCTAppleHealthKit;
sourceTree = "<group>";
};
B50D2EA9671519248AFEBEE7 /* Pods */ = {
isa = PBXGroup;
children = (
AD8403CE6AF2AAD2D7CEE97E /* Pods-RCTAppleHealthKit.debug.xcconfig */,
5ED55FED5925473BC28AF03D /* Pods-RCTAppleHealthKit.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
BF8F8FA9DB6FF33D400AA73E /* Frameworks */ = {
isa = PBXGroup;
children = (
C84411FDBEEBD8BA9C43C813 /* Pods_RCTAppleHealthKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
3774C88C1D2092F20000B3F3 /* RCTAppleHealthKit */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3774C8961D2092F20000B3F3 /* Build configuration list for PBXNativeTarget "RCTAppleHealthKit" */;
buildPhases = (
4827C5812AF01D94AD806134 /* [CP] Check Pods Manifest.lock */,
3774C8891D2092F20000B3F3 /* Sources */,
3774C88A1D2092F20000B3F3 /* Frameworks */,
3774C88B1D2092F20000B3F3 /* CopyFiles */,
Expand Down Expand Up @@ -175,6 +206,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 3774C8841D2092F20000B3F3;
Expand All @@ -187,6 +219,31 @@
};
/* End PBXProject section */

/* Begin PBXShellScriptBuildPhase section */
4827C5812AF01D94AD806134 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-RCTAppleHealthKit-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
3774C8891D2092F20000B3F3 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand All @@ -197,6 +254,7 @@
37837E7D1DCFE270000201A0 /* RCTAppleHealthKit+Methods_Sleep.m in Sources */,
3774C8D41D20C6390000B3F3 /* RCTAppleHealthKit+Methods_Body.m in Sources */,
61232F931E303758000A5026 /* RCTAppleHealthKit+Methods_Mindfulness.m in Sources */,
846A98EA215244E7000C3E5D /* RCTAppleHealthKit+Methods_Dietary.m in Sources */,
64E0E73F1D37947B00EAB905 /* RCTAppleHealthKit+Methods_Results.m in Sources */,
64C42D4A1D351A8800A0A8F7 /* RCTAppleHealthKit+Methods_Vitals.m in Sources */,
3774C8931D2092F20000B3F3 /* RCTAppleHealthKit.m in Sources */,
Expand Down Expand Up @@ -250,6 +308,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "${SRCROOT}/../../ios/Pods/Headers/Public/**";
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -288,6 +347,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "${SRCROOT}/../../ios/Pods/Headers/Public/**";
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
Expand All @@ -297,10 +357,12 @@
};
3774C8971D2092F20000B3F3 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AD8403CE6AF2AAD2D7CEE97E /* Pods-RCTAppleHealthKit.debug.xcconfig */;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../react-native/React/**",
"$(SRCROOT)/../../../React/**",
"${SRCROOT}/../../ios/Pods/Headers/Public/**",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -310,10 +372,12 @@
};
3774C8981D2092F20000B3F3 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5ED55FED5925473BC28AF03D /* Pods-RCTAppleHealthKit.release.xcconfig */;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../react-native/React/**",
"$(SRCROOT)/../../../React/**",
"${SRCROOT}/../../ios/Pods/Headers/Public/**",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1110"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3774C88C1D2092F20000B3F3"
BuildableName = "libRCTAppleHealthKit.a"
BlueprintName = "RCTAppleHealthKit"
ReferencedContainer = "container:RCTAppleHealthKit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3774C88C1D2092F20000B3F3"
BuildableName = "libRCTAppleHealthKit.a"
BlueprintName = "RCTAppleHealthKit"
ReferencedContainer = "container:RCTAppleHealthKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
10 changes: 10 additions & 0 deletions RCTAppleHealthKit.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
6 changes: 5 additions & 1 deletion RCTAppleHealthKit/RCTAppleHealthKit+Methods_Activity.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
// RCTAppleHealthKit
//
// Created by Alexander Vallorosi on 4/27/17.
// Copyright © 2017 Alexander Vallorosi. All rights reserved.
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//

#import "RCTAppleHealthKit.h"

@interface RCTAppleHealthKit (Methods_Activity)

- (void)activity_getActiveEnergyBurned:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback;
- (void)activity_getActiveEnergyDailySamples:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback;
- (void)activity_getBasalEnergyBurned:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback;
- (void)activity_getBasalEnergyDailySamples:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback;

@end
Loading

0 comments on commit fb7bf11

Please sign in to comment.