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
To set up the Sunbird Mobile app, ensure you have installed the following:
NPM version: 6+
Node JS version: 8+
Cordova version: 8+
Ionic version: 4.11.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 the 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.
Clone the SunbirdEd-mobile-app repo
Customising App Configuration - sample.sunbird.properties file is located inside the SunbirdEd-mobile-app > buildConfig folder. The file must be renamed to sunbird.properties, and appropriate values should be provided.
go to the project folder and run
./build.sh
Customising App Configuration
Instance admin of Sunbird adopters can configure various aspects of the Sunbird mobile app based on the requirements of the organization. The admins 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
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:
Installing the Mobile Application
To install the Sunbird Mobile app, follow the steps below:
Create a workspace (Folder Hierarchy) and clone the Git repositories into this folder
Execute the instructions mentioned for each cloned repository
Open terminal and change the directory to “SunbirdEd-mobile-app”
Add one device to the system
Run the command -
$ ionic cordova run android
Generate Multiple Sunbird Apps
Sunbird instance owners 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 the play store (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
Last updated