This section is intended for those are who are building Open edX mobile applications and customizing an Open edX installation to support their use.
There are currently two edX mobile applications, one for iOS and one for Android. You can find the source code and additional documentation for each application here.
For the mobile API and authentication to work correctly with the edX mobile
applications, you enable them in the lms.env.json
file. You then complete
the setup for authentication by creating OAuth clients and adding their IDs to
the custom configuration file of each mobile application.
Note
Configuration settings added to the lms.env.json
file are reset
to their default values when you use Ansible to update edx-platform.
To enable the mobile application features, follow these steps.
In the edx/app/edxapp/lms.env.json
file, add the following lines to the
features section.
"FEATURES" : {
...
"ENABLE_MOBILE_REST_API": true,
"ENABLE_OAUTH2_PROVIDER": true,
"ENABLE_COMBINED_LOGIN_REGISTRATION": true
}
Save the edx/app/edxapp/lms.env.json
file.
Restart the server.
You create an OAuth client ID and secret that are specific to your installation for use by the mobile applications. The procedure that follows assumes that you create a different client for each of the edX mobile applications.
Before you can create OAuth clients, a superuser must exist on the server. For more information, see edX Managing the Full Stack.
To create your OAuth clients, follow these steps.
http://{your_URL}/admin
.https://{your_URL}/api/mobile/{version}/?app=ios
. While the
console requires values for these fields, they are not used by the edX
mobile applications. You can enter the same value in both fields.The procedure that follows assumes that you have a different OAuth client ID for each edX mobile application.
To configure each edX mobile application with its OAuth client ID, you add a setting to its corresponding custom configuration .yaml file. For information about how to set up custom configuration directories and files, see the GitHub repositories for iOS and Android.
Obtain the OAuth client id for the first application from your Django administration console. For more information, see Create the OAuth Clients.
In your custom GitHub configuration directory, edit the .yaml file for the
edX mobile application for iOS. For example, edit your ios.yaml
file.
Add the following line to the .yaml file.
OAUTH_CLIENT_ID: '{client_id_for_iOS_app}'
Save the file.
Repeat steps 1-4 for the edX mobile application for Android.
Courseware videos must be specifically prepared to ensure that they are in mobile accessible formats. Video modules in mobile-available courses should have low resolution encodings that are readily accessible by mobile devices.
After you obtain a low resolution encoding for a video file and post it online, your course team can add its location to the video module that includes the video in the course structure.
html5_sources
. For
more information, see Video Components in the edX Open Learning XML
Guide.You enable push notifications on the server and then configure each of the edX mobile applications. Currently, you can use Parse for notification delivery.
The procedures that follow assume that you have obtained an application ID, REST API key, and client key from Parse.
To enable the push notification feature, follow these steps.
In the edx/app/edxapp/cms.auth.json
file, add the following lines.
PARSE_KEYS = {
"APPLICATION_ID": "{app_id}",
"REST_API_KEY": "{API_key}"
}
edx/app/edxapp/cms.auth.json
file.http://studio.{your_URL}/admin
.The procedure that follows assumes that you use a single set of Parse credentials for both of the edX mobile applications.
You add push notification settings to the applicable custom configuration .yaml file. For information about how to set up custom configuration directories and files, see the GitHub repositories for iOS and Android.
In your custom GitHub configuration directory, edit the .yaml file that
stores configuration settings that are common to both of the edX mobile
applications. For example, edit your shared.yaml
file.
Add the following lines to the .yaml file.
PARSE:
NOTIFICATIONS_ENABLED: true
APPLICATION_ID: {your application id}
CLIENT_KEY: {your client key}
PUSH_NOTIFICATIONS: true
Save the file.