Axon iOS
Axon iOS SDK
Introduction
Medable Axon iOS is an open source library that helps developers create quality research applications quickly and without much hassle.
It interacts with Medable Axon server modules to securely download research studies, population groups, surveys, consent and eligibility tasks, all of which are created in a browser through a user friendly interface (web app) provided by a Medable Axon server.
Read below to get started with creating a research study in Medable.
After this, you need to read the Axon User Guide if you want to know how to configure your study.
Introduction
Medable Axon is composed of a client and a server module, and these are built, respectively, on top of the Cortex iOS SDK and the Cortex API ].
In Medable, everything is contained within Organizations. Hence, Axon objects live within an organization; that is, studies, groups, surveys, etc.
In Medable Axon, the highest priority object is the Study, all data is contained within one Study instance. This is where we can create and configure our research study as we need it to be. One thing to note is that an organization can have more than one study.
Inside a Study we create population groups (i.e.: male, US citizens, older than 21), Survey tasks, Consent tasks for participants to agree with and sign, Eligibility tasks to determine if a person can participate in your study and Active Tasks where the participant can perform different activities to generate results.
Once you have the tasks and the groups, tasks can be assigned to Groups according to your research study's needs. Those assignments can be configured so the task is made available again after a certain period of time since the last time the participant completed it. This is called Task Scheduling. Also, there is a way to define inter task dependency; for example, Task C can't be started until Task A and B are completed. This defines Study Flow. All this works in a per group assignment fashion, meaning that you could have the same tasks depend on each other and be scheduled differently in different groups.
All this functionality is handled by the Medable Axon for iOS library.
Also, there is support for study enrollment, participant onboarding/registration using a regular survey. Regarding enrollment, a Study can be configured to have open enrollment or limited enrollment. Meaning, respectively, that a participant does not require an invitation (or that they do require one) to be able to join a study.
You can even create surveys to gather information before the user is registered, catching non eligible cases too, or participants that didn't agree with the Consent. Hence, data analytics on those use cases are not lost. If a user answered surveys anonymously, and later on he or she registered, all that data is bound to the newly created account for better data analytics.
ResearchKit: What about the visual part of all this?
Medable Axon for iOS converts all the objects into Apple ResearchKit objects and presents participants with the screens to gather all the information for the research study. In other words, everything that researchers or study administrators created and configured server side is reflected in the study app with no change required on the app code. Also, no app update via the app store is required or. This means it's not necessary to submit a new application to the App Store when you want to change the study.
Once the user finishes a task, all the data is securely uploaded to the cloud from the Axon library.
Dependencies
The Medable Axon for iOS requires the following:
- Cortex iOS SDK .
- A Medable Org with Axon enabled
- Sign up here: https://signup.medable.com.
- Contact Medable Sales to have Axon enabled in your org.
- Medable ResearchKit.
- Note: Medable Axon uses a forked version of ResearchKit with bug fixes and improvements. If you have the official ResearchKit integrated already, please remove it to avoid library collisions.
- libPhoneNumber-iOS.
- zxcvbn-ios.
Integration
1- Integrate the dependencies by following the instructions in their respective github pages:
- Integrate the latest Cortex iOS SDK by following the instructions here.
- Integrate our forked version of ResearchKit using our repo version and by following the instructions from here.
- This can be integrated using Cocoapods by adding our source before the
CocoaPods/Specs
and addingpod 'ResearchKit'
to your Podfile and then doingpod install
:
- This can be integrated using Cocoapods by adding our source before the
source 'https://github.com/Medable/Specs'
source 'https://github.com/CocoaPods/Specs'
pod 'ResearchKit'
- Integrate libPhoneNumber-iOS.
- Integrate zxcvbn-ios.
2- Integrate Medable Axon:
- Get a Medable Axon copy.
- Include Medable Axon by just copying and adding the files to your project. The required classes are inside the
/MedableAxon
folder.

- Now, for some reason, the third party libraries' imports are different depending on if they were integrated using Cocoapods or not. To circumvent this, there is a file with those imports in Axon, called
MedableAxonDependencies.h
, that comes configured by default with the non-Cocoapods imports. If the libraries were integrated using Cocoapods, comment those out and uncomment the others.
// Imports for project without CocoaPods
// Zxcvbn
#import <Zxcvbn/DBZxcvbn.h>
// libPhoneNumberiOS
#import <libPhoneNumberiOS/NBPhoneNumber.h>
#import <libPhoneNumberiOS/NBPhoneNumberUtil.h>
// ------------------------------------------------
// Imports for project with CocoaPods
// Zxcvbn
//#import <DBZxcvbn.h>
// libPhoneNumberiOS
//#import <libPhoneNumber-iOS/NBPhoneNumber.h>
//#import <libPhoneNumber-iOS/NBPhoneNumberUtil.h>
Info.plist config entries
Medable Cortex and Medable Axon load their configurations from an entry in your project's Info.plist file.
-
Create a Dictionary entry, called Medable and add the environment config:
- ClientKey.
- Organization.
- BaserURL.
-
Also, provide your study's Id inside the same Medable entry, using StudyId as the key and your study's Id as the value.
- Get your study's Id from the web app.
-
This is how your Medable entry should look like in your app's Info.plist file for both, Medable Cortex and Medable Axon to work properly:

Swift
- Remember that if your project is a Swift project you need to set the bridge header as described here.
- If that is the case, your bridge header should have at least these:
// Base Medable SDK import
#import <Medable/Medable.h>
// Medable Axon import
#import <MedableAxon/MedableAxon.h>
Updated 4 months ago