-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from openedx/develop
Develop to main v1.5
- Loading branch information
Showing
284 changed files
with
10,227 additions
and
4,110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# APIs Compatibility | ||
|
||
This documentation offers guidance on a workaround for utilizing mobile APIs with earlier versions of Open edX releases. | ||
|
||
In December 2023, the [FC-0031 project](https://github.com/openedx/edx-platform/issues/33304) introduced new APIs, and the Open edX mobile apps were transitioned to utilize them. | ||
|
||
If your platform version is older than December 2023, follow the instructions below: | ||
|
||
1. Setup the [mobile-api-extensions](https://github.com/raccoongang/mobile-api-extensions) plugin to your platform. | ||
The Plugin contains extended Open edX APIs for mobile applications. | ||
2. Roll back the modifications that brought in the new APIs [42f518a](https://github.com/openedx/openedx-app-android/commit/42f518a264d4300c8c2ca349072addd7d16ff91a). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Configuration Management | ||
|
||
This documentation provides a comprehensive solution for integrating and managing configuration files in Open edX Android project. | ||
|
||
## Features | ||
- Parsing config.yaml files | ||
- Adding essential keys to `AndroidManifest.xml` (e.g. Microsoft keys) | ||
- Generating Android build config fields. | ||
- Generating config.json file to use the configuration fields at runtime. | ||
- Generating google-services.json with Firebase keys. | ||
|
||
Inside the `Config.kt`, parsing and populating relevant keys and classes are done, e.g. `AgreementUrlsConfig.kt` and `FirebaseConfig.kt`. | ||
|
||
## Getting Started | ||
|
||
### Configuration Setup | ||
|
||
Edit the `config_settings.yaml` in the `default_config` folder. It should contain data as follows: | ||
|
||
```yaml | ||
config_directory: '{path_to_config_folder}' | ||
config_mapping: | ||
prod: 'prod' | ||
stage: 'stage' | ||
dev: 'dev' | ||
# These mappings are configurable, e.g. dev: 'prod_test' | ||
``` | ||
|
||
- `config_directory` provides the path of the config directory. | ||
- `config_mappings` provides mappings that can be utilized to map the Android Build Variant to a defined folder within the config directory, and it will be referenced. | ||
|
||
Note: You can specify `config_directory` to any folder outside the repository to store the configs as a separate project. | ||
|
||
### Configuration Files | ||
In the `default_config` folder, select your environment folder: prod, stage, dev or any other you have created. | ||
Open `config.yaml` and fill in the required fields. | ||
|
||
Example: | ||
|
||
```yaml | ||
API_HOST_URL: 'https://mylmsexample.com' | ||
APPLICATION_ID: 'org.openedx.app' | ||
ENVIRONMENT_DISPLAY_NAME: 'MyLMSExample' | ||
FEEDBACK_EMAIL_ADDRESS: '[email protected]' | ||
OAUTH_CLIENT_ID: 'YOUR_OAUTH_CLIENT_ID' | ||
|
||
PLATFORM_NAME: "MyLMS" | ||
TOKEN_TYPE: "JWT" | ||
|
||
FIREBASE: | ||
ENABLED: false | ||
ANALYTICS_SOURCE: '' | ||
CLOUD_MESSAGING_ENABLED: false | ||
PROJECT_NUMBER: '' | ||
PROJECT_ID: '' | ||
APPLICATION_ID: '' | ||
API_KEY: '' | ||
|
||
MICROSOFT: | ||
ENABLED: false | ||
CLIENT_ID: 'microsoftClientID' | ||
``` | ||
Also, all envirenment folders contain a `file_mappings.yaml` file that points to the config files to be parsed. | ||
|
||
By modifying `file_mappings.yaml`, you can achieve splitting of the base `config.yaml` or add additional configuration files. | ||
|
||
Example: | ||
|
||
```yaml | ||
android: | ||
files: | ||
- auth_client.yaml | ||
- config.yaml | ||
- feature_flags.yaml | ||
``` | ||
|
||
## Available Third-Party Services | ||
- **Firebase:** Analytics, Crashlytics, Cloud Messaging | ||
- **Google:** Sign in and Sign up via Google | ||
- **Microsoft:** Sign in and Sign up via Microsoft | ||
- **Facebook:** Sign in and Sign up via Facebook | ||
- **Branch:** Deeplinks | ||
- **Braze:** Could Messaging | ||
- **SegmentIO:** Analytics | ||
|
||
## Available Feature Flags | ||
- **PRE_LOGIN_EXPERIENCE_ENABLED:** Enables the pre login courses discovery experience. | ||
- **WHATS_NEW_ENABLED:** Enables the "What's New" feature to present the latest changes to the user. | ||
- **SOCIAL_AUTH_ENABLED:** Enables SSO buttons on the SignIn and SignUp screens. | ||
- **COURSE_NESTED_LIST_ENABLED:** Enables an alternative visual representation for the course structure. | ||
- **COURSE_BANNER_ENABLED:** Enables the display of the course image on the Course Home screen. | ||
- **COURSE_TOP_TAB_BAR_ENABLED:** Enables an alternative navigation on the Course Home screen. | ||
- **COURSE_UNIT_PROGRESS_ENABLED:** Enables the display of the unit progress within the courseware. | ||
|
||
## Future Support | ||
- To add config related to some other service, create a class, e.g. `ServiceNameConfig.kt`, to be able to populate related fields. | ||
- Create a `function` in the `Config.kt` to be able to parse and use the newly created service from the main Config. | ||
|
||
Example: | ||
|
||
```Kotlin | ||
fun getServiceNameConfig(): ServiceNameConfig { | ||
return getObjectOrNewInstance(SERVICE_NAME_KEY, ServiceNameConfig::class.java) | ||
} | ||
``` | ||
|
||
```yaml | ||
SERVICE_NAME: | ||
ENABLED: false | ||
KEY: '' | ||
``` | ||
|
||
The `default_config` directory is added to the project to provide an idea of how to write config YAML files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/build | ||
/build | ||
/google-services.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.