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 13 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.xcworkspace
in Xcode - Map your project’s build configuration to
iOS/MyStudies/MyStudies/Default.xcconfig
(instructions) - Update the following in the
Default.xcconfig
file:- Update
STUDY_DATASTORE_URL
with yourStudy datastore
URL - Update
RESPONSE_DATASTORE_URL
with yourResponse datastore
URL - Update
USER_DATASTORE_URL
with yourUser datastore
URL - Update
ENROLLMENT_DATASTORE_URL
with yourEnrollment datastore
URL - Update
CONSENT_DATASTORE_URL
with yourConsent datastore
URL - Update
AUTH_URL
with yourAuth server
URL - Update
HYDRA_BASE_URL
with yourHydra server
URL - Update
HYDRA_CLIENT_ID
with theclient_id
you configured duringHydra
deployment (the mobile applications share aclient_id
with each other, theAuth server
and theParticipant manager
) - Update
API_KEY
with thebundle_id
andapp_token
that you configuredstudy-datastore/src/main/resources/authorizationResource.properties
duringStudy datastore
deployment with format<value of ios.bundleid>:<value of ios.apptoken>
- Update
APP_ID
variable with theAppId
that will be configured by the study administrator in theStudy builder
user interface - Set
APP_TYPE
to either “gateway” or “standalone” - Update
STUDY_ID
key with theStudyId
configured by the study administrator in theStudy builder
user interface (not required for Gateway applications)
- Update
- Configure Firebase Cloud Messaging (FCM) for push notifications
- Go to the Firebase console and select the project you configured for Cloud Firestore during Response datastore deployment.
- Register your app with Firebase and download the
GoogleService-Info.plist
. Move this config file into the root of your Xcode project. - Upload your APNs authentication key to Firebase.
- Add Firebase SDKs and Initialize Firebase in your app.
- Configure your
Participant datastore
instance 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.sql
and 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.sql
script on themystudies_participant_datastore
database that you created duringParticipant datastore
deployment (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.plist
file, 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.plist
file - 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