Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit 11f944e

Browse files
committed
docs: Update mobile application install instructions
1 parent a69127d commit 11f944e

File tree

3 files changed

+268
-246
lines changed

3 files changed

+268
-246
lines changed

en_us/install_operations/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ release.
4040

4141
ecommerce-deprecated/index
4242
insights/index
43+
mobile-deprecated
4344

4445
.. include:: ../../links/links.rst
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
.. _Deprecated Mobile Applications:
2+
3+
############################################
4+
Deprecated Open edX Mobile Applications
5+
############################################
6+
7+
.. warning::
8+
The following instructions refer to the older, now unsupported,
9+
mobile applications. They were last supported in the Quince release.
10+
11+
Please see :ref:`Setting up the Mobile Applications` for more on the current apps.
12+
13+
.. contents::
14+
:local:
15+
:depth: 1
16+
17+
Deprecated Mobile Applications
18+
******************************
19+
20+
Accessing the Source Code
21+
=========================
22+
23+
There are currently two edX mobile applications, one for iOS and one for
24+
Android. You can find the source code and additional documentation for each
25+
application in the following repositories.
26+
27+
* iOS (`iOS app deprecation ticket <https://github.com/openedx/public-engineering/issues/260>`_): http://github.com/openedx-unsupported/edx-app-ios
28+
29+
* Android (`Android app deprecation ticket <https://github.com/openedx/public-engineering/issues/261>`_): http://github.com/openedx-unsupported/edx-app-android
30+
31+
32+
Configuring Mobile Application Features
33+
=======================================
34+
35+
For the mobile API and authentication to work correctly with the edX mobile
36+
applications, you enable them in the ``edx/app/edxapp/lms.yml`` file. You
37+
then complete the setup for authentication by creating OAuth clients and
38+
adding their IDs to the custom configuration file of each mobile application.
39+
40+
Enable Mobile Application Features
41+
----------------------------------
42+
43+
.. note:: Configuration settings added to the ``lms.yml`` file are reset
44+
to their default values when you use Ansible to update edx-platform.
45+
46+
To enable the mobile application features, follow these steps.
47+
48+
#. In the ``edx/app/edxapp/lms.yml`` file, add the following lines to the
49+
features section.
50+
51+
.. code-block:: none
52+
53+
"FEATURES" : {
54+
...
55+
"ENABLE_MOBILE_REST_API": true,
56+
"ENABLE_OAUTH2_PROVIDER": true,
57+
"ENABLE_COMBINED_LOGIN_REGISTRATION": true
58+
  }
59+
60+
If you are running in a non-SSL environment, you can set
61+
``"OAUTH_ENFORCE_SECURE": false``. This configuration setting should never be
62+
set to ``false`` in anything other than a development environment.
63+
64+
#. Save the ``edx/app/edxapp/lms.yml`` file.
65+
66+
#. Restart the server.
67+
68+
.. future: add server- and client-side configuration for Google and Facebook sign in, incl. add ``"ENABLE_THIRD_PARTY_AUTH": true`` to the ``"FEATURES"`` list
69+
70+
.. _Create the OAuth Clients:
71+
72+
73+
Create the OAuth Clients
74+
------------------------------
75+
76+
You create an OAuth client ID and secret that are specific to your
77+
installation for use by the mobile applications. The procedure that follows
78+
assumes that you create a different client for each of the edX mobile
79+
applications.
80+
81+
Before you can create OAuth clients, a superuser must exist on the server. For
82+
more information, see `edX Managing the Full Stack`_.
83+
84+
To create your OAuth clients, follow these steps.
85+
86+
#. Log in to the Django administration console for your base URL. For example,
87+
``http://{your_URL}/admin``.
88+
89+
#. In the **Oauth2** section, select **Clients**.
90+
91+
#. Select **Add client**. A dialog box opens with the **Client id** and
92+
**Client secret** populated for the new client.
93+
94+
#. Enter a **Url** and **Redirect Url** for the first mobile application. For
95+
example, ``https://{your_URL}/api/mobile/{version}/?app=ios``. While the
96+
console requires values for these fields, they are not used by the edX
97+
mobile applications. You can enter the same value in both fields.
98+
99+
#. For the **Client type**, select **Public**.
100+
101+
#. Optionally, enter a **User** and an identifying **Name**.
102+
103+
#. Select **Save and add another**.
104+
105+
#. Repeat steps 4-6 for the second mobile application, and then select
106+
**Save**.
107+
108+
Configure the Applications with OAuth Client IDs
109+
------------------------------------------------
110+
111+
The procedure that follows assumes that you have a different OAuth client ID
112+
for each edX mobile application.
113+
114+
To configure each edX mobile application with its OAuth client ID, you add a
115+
setting to its custom configuration .yaml file. For information about how to
116+
set up custom configuration directories and files, see the GitHub repositories
117+
for `iOS`_ and `Android`_.
118+
119+
#. Obtain the OAuth client ID for the first mobile application from your
120+
Django administration console. For more information, see :ref:`Create the
121+
OAuth Clients`.
122+
123+
#. In your custom GitHub configuration directory, edit the .yaml file for the
124+
first mobile application. For example, for the edX mobile application for
125+
iOS, edit your ``ios.yaml`` file.
126+
127+
#. Add the following line to the .yaml file.
128+
129+
::
130+
131+
OAUTH_CLIENT_ID: '{client_id_for_iOS_app}'
132+
133+
#. Save the file.
134+
135+
#. Repeat steps 1-4 for the second mobile application.
136+
137+
138+
139+
.. _Configure OAuth Token Expiration Days:
140+
141+
Configure OAuth Token Expiration
142+
-----------------------------------
143+
144+
When OAuth tokens expire, learners who use the mobile apps to access your site
145+
must log in again.
146+
147+
The ``lms/envs/common.py`` file includes the default configuration settings for
148+
the number of days before OAuth tokens expire for confidential clients and
149+
public clients. Instead of modifying the defaults in ``lms/envs/common.py``, add
150+
the configuration settings to the ``lms.yml`` file and set values that will
151+
override the default settings.
152+
153+
To configure the number of days before OAuth tokens expire, follow these steps.
154+
155+
#. In the ``edx/app/edxapp/lms.yml`` file, add the following lines to
156+
specify the number of days that OAuth tokens remain valid for confidential
157+
or public clients.
158+
159+
.. note:: Make sure you add these lines at the top level of the JSON
160+
dictionary, and not inside any other declarations.
161+
162+
163+
.. code-block:: none
164+
165+
"OAUTH_EXPIRE_CONFIDENTIAL_CLIENT_DAYS" : 365
166+
"OAUTH_EXPIRE_PUBLIC_CLIENT_DAYS" : 30
167+
168+
#. Save the ``lms.yml`` file, then restart the edxapp app.
169+
170+
The values that you defined in ``lms.yml`` override the default
171+
values defined in ``lms/envs/common.py``.
172+
173+
174+
.. _Configuring Video Modules for Mobile:
175+
176+
Configuring Video Modules for Mobile
177+
=====================================
178+
179+
Course videos must be specifically prepared to ensure that they are in
180+
mobile accessible formats. Video modules in mobile-available courses should
181+
have low resolution encodings that are readily accessible by mobile
182+
devices.
183+
184+
After you obtain a low resolution encoding for a video file and post it
185+
online, your course team can add its location to the video module that
186+
includes the video in the course structure.
187+
188+
* To configure a video module in edX Studio, you edit the video component. On
189+
the **Advanced** tab, in the **Video File URLs** field, enter the URL to the
190+
mobile-targeted video as the first URL in the list. For more information, see
191+
:ref:`Working with Video Components` in *Building and Running
192+
an Open edX Course*.
193+
194+
* To configure a video module by editing the course XML, enter the URL to the
195+
mobile-targeted video as the first URL in the list of ``html5_sources``. For
196+
more information, see :ref:`Video Components` in the *edX
197+
Open Learning XML Guide*.
198+
199+
Enabling Push Notifications
200+
=============================
201+
202+
You enable push notifications on the server and then configure each of the edX
203+
mobile applications. Currently, you can use Parse for notification delivery.
204+
205+
The procedures that follow assume that you have obtained an application ID,
206+
REST API key, and client key from Parse.
207+
208+
Enable Push Notification on the Server
209+
-----------------------------------------
210+
211+
To enable the push notification feature, follow these steps.
212+
213+
#. In the ``edx/app/edxapp/studio.yml`` file, add the following lines.
214+
215+
.. code-block:: none
216+
217+
PARSE_KEYS = {
218+
"APPLICATION_ID": "{app_id}",
219+
"REST_API_KEY": "{API_key}"
220+
}
221+
222+
2. Save the ``edx/app/edxapp/studio.yml`` file.
223+
224+
#. Restart the server.
225+
226+
#. Log in to the Django administration console for your Studio URL. For
227+
example, ``http://studio.{your_URL}/admin``.
228+
229+
#. In the **Contentstore** section, select **Push notification configs**.
230+
231+
#. Select **Add push notification config**.
232+
233+
#. Verify that **Enabled** is selected, and then select **Save**.
234+
235+
Configure Push Notification on the Clients
236+
-----------------------------------------------
237+
238+
The procedure that follows assumes that you use a single set of Parse
239+
credentials for both of the edX mobile applications.
240+
241+
You add push notification settings to the applicable custom configuration
242+
.yaml file. For information about how to set up custom configuration
243+
directories and files, see the GitHub repositories for `iOS`_ and `Android`_.
244+
245+
#. In your custom GitHub configuration directory, edit the .yaml file that
246+
stores configuration settings that are common to both of the edX mobile
247+
applications. For example, edit your ``shared.yaml`` file.
248+
249+
#. Add the following lines to the .yaml file.
250+
251+
::
252+
253+
PARSE:
254+
NOTIFICATIONS_ENABLED: true
255+
APPLICATION_ID: {your application id}
256+
CLIENT_KEY: {your client key}
257+
258+
PUSH_NOTIFICATIONS: true
259+
260+
#. Save the file.
261+
262+
.. include:: ../../links/links.rst

0 commit comments

Comments
 (0)