diff --git a/AsthmaHealth.xcodeproj/project.pbxproj b/AsthmaHealth.xcodeproj/project.pbxproj index a621217..da44556 100644 --- a/AsthmaHealth.xcodeproj/project.pbxproj +++ b/AsthmaHealth.xcodeproj/project.pbxproj @@ -7,10 +7,10 @@ objects = { /* Begin PBXBuildFile section */ - 394D27665E5672044448CDCF /* libPods-AsthmaHealth.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4558CE8C8B08463856C554DF /* libPods-AsthmaHealth.a */; }; 6C3423B11C7D68FA008FFC8E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6C3423B01C7D68FA008FFC8E /* Localizable.strings */; }; 6C8686E81C7F82BA000026DD /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C8686E71C7F82BA000026DD /* MessageUI.framework */; }; 6CC736FD1C7BF8F700F6CBE3 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6CC736FC1C7BF8F700F6CBE3 /* HealthKit.framework */; }; + 827321FEC29042F2D5691109 /* libPods-AsthmaHealthTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDE71F42E9BD227A04AC069B /* libPods-AsthmaHealthTests.a */; }; B403FA9D1C58002300146B3C /* Activities.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B403FA9C1C58002300146B3C /* Activities.storyboard */; }; B403FAA01C5806E400146B3C /* ACMSurveyFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = B403FA9F1C5806E400146B3C /* ACMSurveyFactory.m */; }; B403FAA31C58097600146B3C /* ACMActivitiesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B403FAA21C58097600146B3C /* ACMActivitiesViewController.m */; }; @@ -39,6 +39,7 @@ B4F209241C66EB7100F81180 /* ACMMainPanelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B4F209231C66EB7100F81180 /* ACMMainPanelViewController.m */; }; B4F209271C66F29F00F81180 /* UIViewController+ACM.m in Sources */ = {isa = PBXBuildFile; fileRef = B4F209261C66F29F00F81180 /* UIViewController+ACM.m */; }; B4F2092A1C67002600F81180 /* ACMActivityCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B4F209291C67002600F81180 /* ACMActivityCell.m */; }; + F4DE33EA5624098CBAF2E8A6 /* libPods-AsthmaHealth.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C72FD3671CCF2D2FCA0677DB /* libPods-AsthmaHealth.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -52,8 +53,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 4558CE8C8B08463856C554DF /* libPods-AsthmaHealth.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AsthmaHealth.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 5FCA5FDF42D14EBE6C192A99 /* Pods-AsthmaHealth.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsthmaHealth.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AsthmaHealth/Pods-AsthmaHealth.debug.xcconfig"; sourceTree = ""; }; + 31FFC5624C8F4252F3FDC012 /* Pods-AsthmaHealth.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsthmaHealth.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AsthmaHealth/Pods-AsthmaHealth.debug.xcconfig"; sourceTree = ""; }; + 529EC2AA12E8A352F02270EA /* Pods-AsthmaHealth.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsthmaHealth.release.xcconfig"; path = "Pods/Target Support Files/Pods-AsthmaHealth/Pods-AsthmaHealth.release.xcconfig"; sourceTree = ""; }; 6C3423B01C7D68FA008FFC8E /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; 6C8686E71C7F82BA000026DD /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; 6CC736FC1C7BF8F700F6CBE3 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; @@ -109,7 +110,10 @@ B4F209261C66F29F00F81180 /* UIViewController+ACM.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+ACM.m"; sourceTree = ""; }; B4F209281C67002600F81180 /* ACMActivityCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACMActivityCell.h; sourceTree = ""; }; B4F209291C67002600F81180 /* ACMActivityCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACMActivityCell.m; sourceTree = ""; }; - ED477E84A6745291D4FA5E6F /* Pods-AsthmaHealth.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsthmaHealth.release.xcconfig"; path = "Pods/Target Support Files/Pods-AsthmaHealth/Pods-AsthmaHealth.release.xcconfig"; sourceTree = ""; }; + B6D332361F8B6421AD502B1E /* Pods-AsthmaHealthTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsthmaHealthTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AsthmaHealthTests/Pods-AsthmaHealthTests.release.xcconfig"; sourceTree = ""; }; + C72FD3671CCF2D2FCA0677DB /* libPods-AsthmaHealth.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AsthmaHealth.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + DDE71F42E9BD227A04AC069B /* libPods-AsthmaHealthTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AsthmaHealthTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + E80279F884B5ACB208CEBBEB /* Pods-AsthmaHealthTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsthmaHealthTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AsthmaHealthTests/Pods-AsthmaHealthTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -118,8 +122,8 @@ buildActionMask = 2147483647; files = ( 6C8686E81C7F82BA000026DD /* MessageUI.framework in Frameworks */, - 394D27665E5672044448CDCF /* libPods-AsthmaHealth.a in Frameworks */, 6CC736FD1C7BF8F700F6CBE3 /* HealthKit.framework in Frameworks */, + F4DE33EA5624098CBAF2E8A6 /* libPods-AsthmaHealth.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -127,17 +131,20 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 827321FEC29042F2D5691109 /* libPods-AsthmaHealthTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 45982A8B8F3404D2936E21D4 /* Pods */ = { + 57D5BAF6AA9DBB2CE3C33A78 /* Pods */ = { isa = PBXGroup; children = ( - 5FCA5FDF42D14EBE6C192A99 /* Pods-AsthmaHealth.debug.xcconfig */, - ED477E84A6745291D4FA5E6F /* Pods-AsthmaHealth.release.xcconfig */, + 31FFC5624C8F4252F3FDC012 /* Pods-AsthmaHealth.debug.xcconfig */, + 529EC2AA12E8A352F02270EA /* Pods-AsthmaHealth.release.xcconfig */, + E80279F884B5ACB208CEBBEB /* Pods-AsthmaHealthTests.debug.xcconfig */, + B6D332361F8B6421AD502B1E /* Pods-AsthmaHealthTests.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -147,7 +154,8 @@ children = ( 6C8686E71C7F82BA000026DD /* MessageUI.framework */, 6CC736FC1C7BF8F700F6CBE3 /* HealthKit.framework */, - 4558CE8C8B08463856C554DF /* libPods-AsthmaHealth.a */, + C72FD3671CCF2D2FCA0677DB /* libPods-AsthmaHealth.a */, + DDE71F42E9BD227A04AC069B /* libPods-AsthmaHealthTests.a */, ); name = Frameworks; sourceTree = ""; @@ -158,8 +166,8 @@ B463CC421C4FE13D002B4F9C /* AsthmaHealth */, B463CC5C1C4FE13E002B4F9C /* AsthmaHealthTests */, B463CC411C4FE13D002B4F9C /* Products */, - 45982A8B8F3404D2936E21D4 /* Pods */, A4508778D160FAB64FC7C871 /* Frameworks */, + 57D5BAF6AA9DBB2CE3C33A78 /* Pods */, ); sourceTree = ""; }; @@ -292,12 +300,12 @@ isa = PBXNativeTarget; buildConfigurationList = B463CC621C4FE13E002B4F9C /* Build configuration list for PBXNativeTarget "AsthmaHealth" */; buildPhases = ( - 277F08F9B6B5E811FF7CA812 /* Check Pods Manifest.lock */, + 1FF36A99B2F191874D1FA935 /* [CP] Check Pods Manifest.lock */, B463CC3C1C4FE13D002B4F9C /* Sources */, B463CC3D1C4FE13D002B4F9C /* Frameworks */, B463CC3E1C4FE13D002B4F9C /* Resources */, - 547487C04960D83E3C101CD3 /* Embed Pods Frameworks */, - C57C59DDE52293AFB42D5DC7 /* Copy Pods Resources */, + 0649E48B1396D18F631E2BFE /* [CP] Embed Pods Frameworks */, + 4859B429DAC42517D0917D70 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -312,9 +320,12 @@ isa = PBXNativeTarget; buildConfigurationList = B463CC651C4FE13E002B4F9C /* Build configuration list for PBXNativeTarget "AsthmaHealthTests" */; buildPhases = ( + AFE3B767365C69E84D1DE93A /* [CP] Check Pods Manifest.lock */, B463CC551C4FE13E002B4F9C /* Sources */, B463CC561C4FE13E002B4F9C /* Frameworks */, B463CC571C4FE13E002B4F9C /* Resources */, + F3023E70E0FD78412B01C217 /* [CP] Embed Pods Frameworks */, + 7291074BDF322E03F135129E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -396,44 +407,44 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 277F08F9B6B5E811FF7CA812 /* Check Pods Manifest.lock */ = { + 0649E48B1396D18F631E2BFE /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsthmaHealth/Pods-AsthmaHealth-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 547487C04960D83E3C101CD3 /* Embed Pods Frameworks */ = { + 1FF36A99B2F191874D1FA935 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsthmaHealth/Pods-AsthmaHealth-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - C57C59DDE52293AFB42D5DC7 /* Copy Pods Resources */ = { + 4859B429DAC42517D0917D70 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "[CP] Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -441,6 +452,51 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsthmaHealth/Pods-AsthmaHealth-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 7291074BDF322E03F135129E /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsthmaHealthTests/Pods-AsthmaHealthTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + AFE3B767365C69E84D1DE93A /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + F3023E70E0FD78412B01C217 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsthmaHealthTests/Pods-AsthmaHealthTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -573,14 +629,14 @@ }; B463CC631C4FE13E002B4F9C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5FCA5FDF42D14EBE6C192A99 /* Pods-AsthmaHealth.debug.xcconfig */; + baseConfigurationReference = 31FFC5624C8F4252F3FDC012 /* Pods-AsthmaHealth.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AsthmaHealth/AsthmaHealth.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 0.0.2; - INFOPLIST_FILE = "AsthmaHealth/SupportingFiles/Info.plist"; + INFOPLIST_FILE = AsthmaHealth/SupportingFiles/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.cloudmineinc.AsthmaHealth; @@ -593,14 +649,14 @@ }; B463CC641C4FE13E002B4F9C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = ED477E84A6745291D4FA5E6F /* Pods-AsthmaHealth.release.xcconfig */; + baseConfigurationReference = 529EC2AA12E8A352F02270EA /* Pods-AsthmaHealth.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AsthmaHealth/AsthmaHealth.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution: CloudMine LLC (72894QCBVZ)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: CloudMine LLC (72894QCBVZ)"; CURRENT_PROJECT_VERSION = 0.0.2; - INFOPLIST_FILE = "AsthmaHealth/SupportingFiles/Info.plist"; + INFOPLIST_FILE = AsthmaHealth/SupportingFiles/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.cloudmineinc.AsthmaHealth; @@ -613,6 +669,7 @@ }; B463CC661C4FE13E002B4F9C /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = E80279F884B5ACB208CEBBEB /* Pods-AsthmaHealthTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; INFOPLIST_FILE = AsthmaHealthTests/Info.plist; @@ -625,6 +682,7 @@ }; B463CC671C4FE13E002B4F9C /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = B6D332361F8B6421AD502B1E /* Pods-AsthmaHealthTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; INFOPLIST_FILE = AsthmaHealthTests/Info.plist; diff --git a/AsthmaHealth/Models/ACMConsentDocument.m b/AsthmaHealth/Models/ACMConsentDocument.m index ef5f42b..c9c9049 100644 --- a/AsthmaHealth/Models/ACMConsentDocument.m +++ b/AsthmaHealth/Models/ACMConsentDocument.m @@ -14,6 +14,7 @@ - (instancetype)init self.sections = ACMConsentDocument.sections; ORKConsentSignature *signature = [ORKConsentSignature signatureForPersonWithTitle:nil dateFormatString:nil identifier:ACMSignatureIdentifier]; + signature.requiresName = NO; [self addSignature:signature]; return self; diff --git a/AsthmaHealth/Models/ACMConsentTask.m b/AsthmaHealth/Models/ACMConsentTask.m index 2d763a7..e5e2d05 100644 --- a/AsthmaHealth/Models/ACMConsentTask.m +++ b/AsthmaHealth/Models/ACMConsentTask.m @@ -19,39 +19,32 @@ + (instancetype)task ORKConsentReviewStep *reviewStep = [[ORKConsentReviewStep alloc] initWithIdentifier:ACMReviewConsentIdentifier signature:consentDoc.signatures.firstObject inDocument:consentDoc]; reviewStep.reasonForConsent = NSLocalizedString(@"ACMConsentTaskReason", nil); - ACMConsentTask *consentTask = [[ACMConsentTask alloc] initWithIdentifier:ACMConsentTaskIdentifier steps:@[consentStep, self.sharingOptionStep, reviewStep]]; + ACMConsentTask *consentTask = [[ACMConsentTask alloc] initWithIdentifier:ACMConsentTaskIdentifier + steps:@[consentStep, self.sharingStep, + reviewStep, self.registrationStep]]; return consentTask; } # pragma mark Private Factories -+ (ORKQuestionStep *)sharingOptionStep ++ (ORKConsentSharingStep *)sharingStep { - ORKTextChoiceAnswerFormat *format = [[ORKTextChoiceAnswerFormat alloc] initWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:self.sharingChoices]; - - ORKQuestionStep *question = [ORKQuestionStep questionStepWithIdentifier:ACMSharingQuestionIdentifier - title:NSLocalizedString(@"ACMConsentTaskSharingOptionTitle", nil) - text:NSLocalizedString(@"ACMConsentTaskSharingOptionText", nil) - answer:format]; - question.optional = NO; - - return question; + return [[ORKConsentSharingStep alloc] initWithIdentifier:ACMSharingQuestionIdentifier + investigatorShortDescription:NSLocalizedString(@"ACMInstitutionNameShortText", nil) + investigatorLongDescription:NSLocalizedString(@"ACMInstitutionNameShortText", nil) + localizedLearnMoreHTMLContent:NSLocalizedString(@"ACMConsentTaskSharingOptionText", nil)]; } -+ (NSArray *)sharingChoices ++ (ORKRegistrationStep *)registrationStep { - ORKTextChoice *choice1 = [[ORKTextChoice alloc] initWithText:NSLocalizedString(@"ACMConsentTaskSharingChoicesText1", nil) - detailText:nil - value:@"ACMSharingOptionBroad" - exclusive:YES]; - - ORKTextChoice *choice2 = [[ORKTextChoice alloc] initWithText:NSLocalizedString(@"ACMConsentTaskSharingChoicesText2", nil) - detailText:nil - value:@"ACMSharingOptionNarrow" - exclusive:YES]; - - return @[choice1, choice2]; + ORKRegistrationStepOption options = ORKRegistrationStepIncludeDOB | ORKRegistrationStepIncludeGender | + ORKRegistrationStepIncludeGivenName | ORKRegistrationStepIncludeFamilyName; + + return [[ORKRegistrationStep alloc] initWithIdentifier:@"ACMParticipantRegistrationStep" + title:NSLocalizedString(@"Registration", nil) + text:NSLocalizedString(@"Create an account", nil) + options:options]; } @end diff --git a/AsthmaHealth/SupportingFiles/Localizable.strings b/AsthmaHealth/SupportingFiles/Localizable.strings index 984dacb..0e24439 100644 --- a/AsthmaHealth/SupportingFiles/Localizable.strings +++ b/AsthmaHealth/SupportingFiles/Localizable.strings @@ -24,4 +24,8 @@ "ACMConsentTaskSharingChoicesText1" = "Share my data with ACME Hospital and qualified researchers worldwide"; -"ACMConsentTaskSharingChoicesText2" = "Only share my data with ACME Hospital and its partners"; \ No newline at end of file +"ACMConsentTaskSharingChoicesText2" = "Only share my data with ACME Hospital and its partners"; + +"ACMInstitutionNameShortText" = "ACME Hospital"; + +"ACMInstitutionNameLongText" = "ACME Hospital"; \ No newline at end of file diff --git a/AsthmaHealth/ViewControllers/ACMMainPanelViewController.h b/AsthmaHealth/ViewControllers/ACMMainPanelViewController.h index 9ba534b..6c16ecb 100644 --- a/AsthmaHealth/ViewControllers/ACMMainPanelViewController.h +++ b/AsthmaHealth/ViewControllers/ACMMainPanelViewController.h @@ -9,7 +9,7 @@ static NSString *_Nullable const ACMSurveyDataNotification = @"ACMSurveyDataFetc @property (nonatomic, nullable, readonly) NSArray *surveyResults; - (void)refreshData; -- (void)uploadResult:(ORKResult *_Nonnull)surveyResult; +- (void)uploadResult:(ORKTaskResult *_Nonnull)surveyResult; - (NSInteger)countOfSurveyResultsWithIdentifier:(NSString *_Nonnull)identifier; - (NSInteger)countOfSurveyResultsWithIdentifier:(NSString *_Nonnull)identifier onCalendarDay:(NSDate *_Nonnull)day; diff --git a/AsthmaHealth/ViewControllers/ACMMainPanelViewController.m b/AsthmaHealth/ViewControllers/ACMMainPanelViewController.m index 009b3dc..437ad64 100644 --- a/AsthmaHealth/ViewControllers/ACMMainPanelViewController.m +++ b/AsthmaHealth/ViewControllers/ACMMainPanelViewController.m @@ -79,7 +79,7 @@ - (void)refreshData }]; } -- (void)uploadResult:(ORKResult *_Nonnull)surveyResult; +- (void)uploadResult:(ORKTaskResult *_Nonnull)surveyResult; { [self showLoading:YES]; @@ -117,10 +117,10 @@ - (NSInteger)countOfSurveyResultsWithIdentifier:(NSString *_Nonnull)identifier o #pragma mark Getters-Setters - (ACMAppDelegate *)appDelegate { - ACMAppDelegate *appDelegate = [UIApplication sharedApplication].delegate; + id appDelegate = [UIApplication sharedApplication].delegate; NSAssert([appDelegate isKindOfClass:[ACMAppDelegate class]], @"App Delegate is unexpected type: %@", [appDelegate class]); - return appDelegate; + return (ACMAppDelegate *)appDelegate; } #pragma mark Private diff --git a/AsthmaHealth/ViewControllers/ACMOnboardingViewController.m b/AsthmaHealth/ViewControllers/ACMOnboardingViewController.m index 3f6ccab..54745d3 100644 --- a/AsthmaHealth/ViewControllers/ACMOnboardingViewController.m +++ b/AsthmaHealth/ViewControllers/ACMOnboardingViewController.m @@ -2,19 +2,19 @@ #import "ACMConsentViewController.h" #import "ACMalerter.h" #import "ACMAppDelegate.h" +#import "UIColor+ACM.h" static NSString *const ACMSignUpSegueIdentifier = @"ACMSignUpSegue"; -@interface ACMOnboardingViewController () - -@property (nonatomic, nullable) ORKTaskResult* consentResults; +@interface ACMOnboardingViewController () @property (weak, nonatomic) IBOutlet UIButton *joinStudyButton; @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; - @end @implementation ACMOnboardingViewController +#pragma mark Lifecycle + - (void)viewDidLoad { [super viewDidLoad]; @@ -41,11 +41,15 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender } #pragma mark Target/Action + - (IBAction)loginButtonDidPress:(UIButton *)sender { - CMHAuthViewController *loginViewController = [CMHAuthViewController loginViewController]; - loginViewController.delegate = self; - [self presentViewController:loginViewController animated:YES completion:nil]; + CMHLoginViewController *loginVC = [[CMHLoginViewController alloc] initWithTitle:NSLocalizedString(@"Log In", nil) + text:NSLocalizedString(@"Please log in to you account to store and access your research data.", nil) + delegate:self]; + loginVC.view.tintColor = [UIColor acmBlueColor]; + + [self presentViewController:loginVC animated:YES completion:nil]; } @@ -75,68 +79,57 @@ - (void)taskViewController:(ORKTaskViewController *)taskViewController didFinish break; } - self.consentResults = nil; [self dismissViewControllerAnimated:YES completion:nil]; } -#pragma mark CMHAuthViewDelegate +#pragma mark CMHLoginViewControllerDelegate -- (void)authViewCancelledType:(CMHAuthType)authType +- (void)loginViewControllerCancelled:(CMHLoginViewController *)viewController { - if (![self.presentedViewController isKindOfClass:[CMHAuthViewController class]]) { - return; - } - [self dismissViewControllerAnimated:YES completion:nil]; } -- (void)authViewOfType:(CMHAuthType)authType didSubmitWithEmail:(NSString *)email andPassword:(NSString *)password +- (void)loginViewController:(CMHLoginViewController *)viewController didLogin:(BOOL)success error:(NSError *)error { - [self.activityIndicator startAnimating]; - [self dismissViewControllerAnimated:YES completion:nil]; - - switch (authType) { - case CMHAuthTypeLogin: - [self loginWithEmail:email andPassword:password]; - break; - case CMHAuthTypeSignup: - [self signupWithEmail:email andPassword:password]; - default: - break; + if (!success) { + [self.activityIndicator stopAnimating]; + [ACMAlerter displayAlertWithTitle:NSLocalizedString(@"Sign In Failure", nil) + andMessage:[NSString localizedStringWithFormat:@"Sign in failed, please try again. %@", error.localizedDescription] + inViewController:viewController]; + return; } + + [self.appDelegate loadMainPanel]; } -#pragma mark Private Helprs +#pragma mark Private Helpers - (void)handleConsentCompleted { NSAssert([self.presentedViewController isKindOfClass:[ACMConsentViewController class]], @"Attempted -handleConsentCompletd when a ACMConsentViewController was not presented"); - self.consentResults = ((ACMConsentViewController *)self.presentedViewController).result; + ORKTaskResult *onboardingResults = ((ACMConsentViewController *)self.presentedViewController).result; [self dismissViewControllerAnimated:YES completion:nil]; - - CMHAuthViewController *signupViewController = [CMHAuthViewController signupViewController]; - signupViewController.delegate = self; - - [self presentViewController:signupViewController animated:YES completion:nil]; + + [self signupWithOnboardingResults:onboardingResults]; } -- (void)signupWithEmail:(NSString *_Nonnull)email andPassword:(NSString *_Nonnull)password +- (void)signupWithOnboardingResults:(ORKTaskResult *)results { - [CMHUser.currentUser signUpWithEmail:email password:password andCompletion:^(NSError * _Nullable error) { - if (nil != error) { + [CMHUser.currentUser signUpWithRegistration:results andCompletion:^(NSError * _Nullable signupError) { + if (nil != signupError) { dispatch_async(dispatch_get_main_queue(), ^{ [self.activityIndicator stopAnimating]; [ACMAlerter displayAlertWithTitle:NSLocalizedString(@"Sign up Failed", nil) - andMessage:error.localizedDescription + andMessage:signupError.localizedDescription inViewController:self]; }); return; } - [CMHUser.currentUser uploadUserConsent:self.consentResults forStudyWithDescriptor:@"ACMHealth" andCompletion:^(NSError * _Nullable consentError) { + [CMHUser.currentUser uploadUserConsent:results forStudyWithDescriptor:@"ACMHealth" andCompletion:^(CMHConsent * _Nullable consent, NSError * _Nullable consentError) { if (nil != consentError) { dispatch_async(dispatch_get_main_queue(), ^{ [self.activityIndicator stopAnimating]; @@ -154,25 +147,6 @@ - (void)signupWithEmail:(NSString *_Nonnull)email andPassword:(NSString *_Nonnul }]; } -- (void)loginWithEmail:(NSString *_Nonnull)email andPassword:(NSString *_Nonnull)password -{ - [CMHUser.currentUser loginWithEmail:email password:password andCompletion:^(NSError * _Nullable error) { - if (nil != error) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self.activityIndicator stopAnimating]; - [ACMAlerter displayAlertWithTitle:NSLocalizedString(@"Sign In Failure", nil) - andMessage:[NSString localizedStringWithFormat:@"Sign in failed, please try again. %@", error.localizedDescription] - inViewController:self]; - }); - return; - } - - dispatch_async(dispatch_get_main_queue(), ^{ - [self.appDelegate loadMainPanel]; - }); - }]; -} - - (void)removeNavigationBarDropShadow { UINavigationBar *navigationBar = self.navigationController.navigationBar; @@ -189,7 +163,7 @@ - (ACMAppDelegate *)appDelegate return nil; } - return [UIApplication sharedApplication].delegate; + return (ACMAppDelegate *)[UIApplication sharedApplication].delegate; } @end diff --git a/Podfile b/Podfile index c1cbada..992f9d5 100644 --- a/Podfile +++ b/Podfile @@ -1,8 +1,10 @@ platform :ios, '9.0' target 'AsthmaHealth' do - pod 'CMHealth', '0.2.1' -end + pod 'CMHealth', '~> 0.5' + + target 'AsthmaHealthTests' do + inherit! :search_paths + end -target 'AsthmaHealthTests' do end diff --git a/Podfile.lock b/Podfile.lock index 071bd3b..289d124 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -20,26 +20,28 @@ PODS: - AFNetworking/UIKit (2.6.3): - AFNetworking/NSURLConnection - AFNetworking/NSURLSession - - CloudMine (1.7.10): + - CareKit (1.0.2) + - CloudMine (1.7.12): - AFNetworking (~> 2.6.3) - - CloudMine/no-arc (= 1.7.10) - - CloudMine/no-arc (1.7.10): + - CloudMine/no-arc (= 1.7.12) + - CloudMine/no-arc (1.7.12): - AFNetworking (~> 2.6.3) - - CMHealth (0.2.1): + - CMHealth (0.5.0): + - CareKit (~> 1.0.1) - CloudMine (~> 1.7) - - ResearchKit (~> 1.3) - - TPKeyboardAvoiding (~> 1.2) - - ResearchKit (1.3.0) - - TPKeyboardAvoiding (1.2.11) + - ResearchKit (~> 1.3.1) + - ResearchKit (1.3.1) DEPENDENCIES: - - CMHealth (= 0.2.1) + - CMHealth (~> 0.5) SPEC CHECKSUMS: AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 - CloudMine: fbe400214143095f10b357025101dd6153ec6fd4 - CMHealth: d940547bb9632f5452cae172f9b796c4137cf90e - ResearchKit: 934a1efefed1a3a9150002a1e4b123d0c86c3f2e - TPKeyboardAvoiding: e5ce146b313de063957bfa75a13f1e9b0ff18ab7 + CareKit: 377857f33d3795ed6d24a5df116154773265f81a + CloudMine: 44e949fef2c3943cad2c375fa4d8c7cc87113275 + CMHealth: 966abb6a8d9689642e11c5f29a87ef2a761775c8 + ResearchKit: badba0340dd71d1cbab4789a0bf01b26022b8f94 -COCOAPODS: 0.39.0 +PODFILE CHECKSUM: bba9ed9b61e5d85147128d32f2dda41551e637a4 + +COCOAPODS: 1.0.1