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 13 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 the boolean
IsStandaloneStudyApp
value to “gateway” or “standalone” iniOS/MyStudies/MyStudies/Branding/Generic/Branding.plist
- Update
StandaloneStudyId
key iniOS/MyStudies/MyStudies/Branding/Generic/Branding.plist
with theStudyId
configured by the study administrator in theStudy builder
user interface (not required for Gateway applications)
- Update
- If you haven't already created the Firebase project then, add Firebase to your Xcode project and make sure that Google Analytics is enabled in your Firebase project:
- If you're creating a new Firebase project, enable Google Analytics during the project creation workflow.
- If you're using an existing Firebase project that doesn't have Google Analytics enabled, go to the Integrations tab of your settings > Project settings to enable it.
- When you enable Google Analytics in your project, your Firebase apps are linked to Google Analytics data streams.
- Add a Firebase configuration file into the root of your Xcode project for using firebase services.
- Enable push notifications by creating push notification certificates in encrypted
.p12
format (for more information, visit Establishing a Certificate-Based Connection to APNs) - Enable push notification by token based connection with an authentication token signing key, specified as a text file (with a .p8 file extension).
- Enable FCM based push notification by uploading your APNs authentication key to Firebase.
- 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 screenNavigationTitleName
- 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 2022 Google LLC