Skip to content

Latest commit

 

History

History
89 lines (52 loc) · 12 KB

sunbird-mobile.md

File metadata and controls

89 lines (52 loc) · 12 KB

Sunbird Mobile

Introduction

The Sunbird Mobile app provides mobility to its feature-rich learning platform. It provides learners with the flexibility to learn anywhere, anytime.

Prerequisites


1.To set up Sunbird mobile app, ensure you have installed the following:
 a) NPM Version - 6.+
 b) Node JS Version - 8.+
 c) Cordova Version - 8.+
 d) Ionic Version - 4.11.2
2. Generate the key and secret for the mobile app user using the JWT token of the mobile admin user. Run the OnboardConsumers Jenkins Job and take the jwt token(JWT token for mobile_admin) from Jenkins Output.

Generating Secret: Execute the listed API to generate the key and secret for the mobile app:

curl -X POST \ <your-sunbird-base-url>/api/api-manager/v1/consumer/mobile_app/credential/register \ -H ‘authorization: Bearer <mobile_admin_jwt_token_from_jenkins_job_output>’ \ -H ‘content-type: application/json’ \ -d ‘{ “request”: { “key”: “<implementation-name>-mobile-app- <version-number>” } }’

Response body:

{“result”:{“key”:”<implementation-name>-mobile-app-<version-number>”,”secret”:”<secret>”}}

Use the key and secret from the response given for MOBILE_APP_KEY and MOBILE_APP_SECRET configuration in respective environments in gradle.properties file. Example:

dev_mobile_app_key = “<implementation-name>-mobile-app-<version-number>” dev_mobile_app_secret = “<secret>“

Producer Key

Replace the producer id PRODUCER_ID for respective environments in sunbird.properties.

Fabric credentials:

Replace release_fabric_api_key in sunbird.properties with your fabric API Key. Create an account in fabric.io and register in the app to get the API key.

Set up mobile app workspace from Git Repository

Sunbird mobile app can be built from the main source code which is available at SunbirdEd-mobile-app.

Customising App Configuration

Instance admin of Sunbird adopters can configure various aspects of the Sunbird mobile app based on the requirement of the the organization. The admin are able to configure various aspects such as:

  • App name
  • App logo
  • Login/Guest page to new users
  • Sign in footer card on the app
  • Onboarding cards
  • Categories in the profile page
S NO.VARIABLE NAMEDESCRIPTIONPURPOSEDEFAULT VALUE
1dev_app_id/staging_app_id/production_app_idThe app ID in the SunbirdEd-mobile-app/buildConfig/sunbird.properties file with the implementation-specific application IDTo change the app IDappId: “org.sunbird.app”
2app nameNavigate to the SunbirdEd-mobile-app/config.xml file and enter the required app nameTo change the app name
3app logoNavigate to SunbirdEd-mobile-app/resources/android/iconReplace the ic_launcher.png image with your desired logo in all the mipmap and drawable folders. The logo name should be drawable-ldpi-icon.pngTo change the app logo
4splash imageNavigate to SunbirdEd-mobile-app/resources/android/splashReplace the drawable-ldpi-icon.png, drawable-hdpi-icon.png, drawable-xhdpi-icon.png image with your desired image.To change the splash image
5appSet the configuration variable in the SunbirdEd-mobile-app repo file in the buildConfig folder
6app version codeVersion code for the app releaseTo customize the end points in the appReplace redirect base url REDIRECT_BASE_URL and all other base urls with your respective domain name in sunbird.properties
7deep link schemaThis plugin handles deeplinks on iOS and Android for both custom URL scheme links and Universal App Links. Deep link schema can be changed from sunbird.propertiesChange the “dev_deeplink_base_url = dev.open-sunbird.org” to the required name
8display_onboarding_pageset the configuration variable inside the SunbirdEd-mobile-app repo inside buildConfig folderto display the onboarding pagefalse
9display_signin_footer_card_in_course_tab_for_teacherset the display_signin_footer_card_in_course_tab_for_teachervariable as true in sunbird.properties fileto show the sign-in footer in the course tab for teachersfalse
10display_signin_footer_card_in_library_tab_for_teacherSet the display_signin_footer_card_in_library_tab_for_teacher variable true in sunbird.properties fileto show the sign-in footer in the library tab for teachersfalse
11display_signin_footer_card_in_profile_tab_for_teacherSet the display_signin_footer_card_in_profile_tab_for_teacheras true in sunbird.properties fileto show the sign-in footer in the profile tab for teachersfalse
12display_signin_footer_card_in_profile_tab_for_studentSet the display_signin_footer_card_in_profile_tab_for_studentas true in sunbird.properties fileto show the sign-in footer in the profile tab for studentsfalse
13display_signin_footer_card_in_library_tab_for_studentSet the display_signin_footer_card_in_library_tab_for_studentas true in sunbird.properties fileto show the sign-in footer in the profile tab for studentsfalse
14display_onboarding_cardset the display__onboarding_cards as true in sunbird.properties fileto display the guest/login pagefalse
15display_framework_categories_in_profileset the display_framework_categories_in_profile variable as true in sunbird.properties fileto display categories in the guest/login pagefalse
16track_user_telemetryVariable used to track user telemetry.Used to track telemetry that is missing at the device level so as to generate greater usage context within the instance. Set the variable as true in the sunbird.properties file to enable tracking.false
17content_streaming_enabledVariable used to enable content streamingUsed to enable content streaming. Set the variable as true in the sunbird.properties file to enable content streamingfalse
18open_rapdiscovery_enabledVariable used to enable OPENRAP discoveryUsed to enable OPENRAP discovery. Set the variable as true in the sunbird.properties file to enable OPENRAP discoveryfalse
19display_onboarding_category_pageVariable used to enable onboarding category selection pageUsed to onboarding category selection page in the onboarding process. Set the variable as true in the sunbird.properties file to enable onboarding category selection page.false
20display_onboarding_scan_pageVariable used to enable onboarding scan page.Used to enable onboarding scan page in the onboarding process. Set the variable as true in the sunbird.properties file to onboarding scan pagefalse
21support_emailVariable used to setUsed to set the support email id. Set the variable as <valid_email_id> in the sunbird.properties file to set support email id<valid_email_id>
22dev_custom_scheme/staging_custom_scheme/production_custom_schemeScheme used to redrirect chrome custom tab back to mobile app “org.sunbird.app”

Packaging Framework and Form Data

Sunbird mobile app supports configuration of the app framework to enable offline usage of the app. To configure the app framework, adopter needs to package the channel for the respective framework. Details of the file naming convention and folder location are given below:

S NO.FOLDERFILE NAMEPURPOSE
1buildConfig/data/frameworkframework-<FRAMEWORK_IDENTIFIER<.jsonTo package the channel for the respective framework. Same framework must be listed in the channel’s suggestedFramework list
2buildConfig/data/channelchannel-<CHANNEL_IDENTIFIER>.jsonTo package the channel. To support offline usage custodianOrgId channel must be included in the bundle
3buildConfig/data/formpageassemble_course_filter.jsonPage assemble filter for course
4buildConfig/data/formpageassemble_library_filter.jsonPage assemble filter for library
5buildConfig/data/system<system-setting-custodianOrgId>.jsoncustodianOrgId channelid for the mobile app
6buildConfig/data/systemsystem-setting-courseFrameworkId.jsoncourseFrameworkId for the TPD workflow
7buildConfig/data/notificationconfiglocal_notofocation_config.jsonConfiguration for local Notification setup in mobile

Installing the Mobile Application

1.Create a workspace (Folder Hierarchy) and clone the Git repositories into this folder

2.Execute the instructions mentioned for each cloned repository

3.Open terminal and change the directory to “SunbirdEd-mobile-app”

4.Add one device to the system

5.Run the command- $ ionic cordova run android

Generate Multiple Sunbird Apps

As a Sunbird instance owner, owner should be able to generate multiple apps for multiple environments(dev/qa/production) so that user can use all the apps simultaneously. For each app, user should be able to have different content stores (on the local device), fire telemetry from separate app identifiers and upload to playstore (if need be).

Configuration

Instance admin of Sunbird adopters can configure the appId in the following way to acheive the functionality

  • dev_app_id = org.sample.app.dev
  • staging_app_id = org.sample.app.staging
  • production_app_id = org.sample.app