This directory contains all the code necessary to build the FDA MyStudies iOS application for study participants. Customization of the Default.xcconfig and Branding.plist files will enable your iOS application to interact with the other components of your FDA MyStudies deployment. Further customization of app branding can be accomplished by replacing the default application images with your own. All configuration related to the creation and operation of studies is done using the Study builder without need for code changes or redeployment of the mobile application.
The FDA MyStudies iOS application requires Xcode 11 or newer, and can be run on iOS versions 11 and above.
The FDA MyStudies mobile application fetches all study, schedule, activity, eligibility, consent and notification information from the Study datastore and posts pseudonymized participant response data to the Response datastore. Consent forms and any other identifiable data is posted to the Participant datastore. Email and password authentication is handled by the MyStudies Auth server using OAuth 2.0.
- Open the
iOS/MyStudies/MyStudies.xcworkspacein Xcode - Map your project’s build configuration to
iOS/MyStudies/MyStudies/Default.xcconfig(instructions) - Update the following in the
Default.xcconfigfile:- Update
STUDY_DATASTORE_URLwith yourStudy datastoreURL - Update
RESPONSE_DATASTORE_URLwith yourResponse datastoreURL - Update
USER_DATASTORE_URLwith yourUser datastoreURL - Update
ENROLLMENT_DATASTORE_URLwith yourEnrollment datastoreURL - Update
CONSENT_DATASTORE_URLwith yourConsent datastoreURL - Update
AUTH_URLwith yourAuth serverURL - Update
HYDRA_BASE_URLwith yourHydra serverURL - Update
HYDRA_CLIENT_IDwith theclient_idyou configured duringHydradeployment (the mobile applications share aclient_idwith each other, theAuth serverand theParticipant manager) - Update
API_KEYwith thebundle_idandapp_tokenthat you configuredstudy-datastore/src/main/resources/authorizationResource.propertiesduringStudy datastoredeployment with format<value of ios.bundleid>:<value of ios.apptoken> - Update
APP_IDvariable with theAppIdthat will be configured by the study administrator in theStudy builderuser interface - Set
APP_TYPEto either “gateway” or “standalone” - Update
STUDY_IDkey with theStudyIdconfigured by the study administrator in theStudy builderuser interface (not required for Gateway applications)
- Update
- Enable push notifications by creating push notification certificates in encrypted
.p12format (for more information, visit Establishing a Certificate-Based Connection to APNs) - Configure your
Participant datastoreinstance to interface with your mobile application (skip this step if following the semi-automated deployment guide - you will complete an automated version of this task when you return to that guide)- Make a copy of the
participant-datastore/sqlscript/mystudies_app_info_update_db_script.sqland update the values to match your iOS configuration - Optionally, configure the Android fields to match your Android configuration (not necessary if you are not configuring an Android application, or if you have already completed this step during Android configuration)
- Run your updated
mystudies_app_info_update_db_script.sqlscript on themystudies_participant_datastoredatabase that you created duringParticipant datastoredeployment (instructions)
- Make a copy of the
- Optional. Customize images and text
- Replace icons and images in
iOS/MyStudies/MyStudies/Assets/Assets.xcassets - Update user-facing text in the
iOS/MyStudies/MyStudies/Branding/Generic/Branding.plistfile, fields to consider include:ProductTitleName- Application name that is shown to the userWebsiteButtonTitle- Text of the link that is shown on the overview screenWebsiteLink- Destination of the link that is shown on the overview screenTermsAndConditionURL- Destination for the terms and conditions linkPrivacyPolicyURL- Destination for the privacy policy linkNavigationTitleName- The navigation bar title that is shown to users
- Update introductory information presented to users in the
iOS/MyStudies/MyStudies/Utils/Resources/Plists/UI/GatewayOverview.plistfile - Additional resource documents can be made available to users by adding PDF files to
iOS/MyStudies/MyStudies/Assets/OtherAssets/and creating a corresponding entry iniOS/MyStudies/MyStudies/Models/Resource/Resources.plist
- Replace icons and images in
Instructions for building and deploying iOS applications can be found here.
Copyright 2020 Google LLC
