The Sunbird Mobile app is the app-based interface for the Sunbird application stack. It provides a app(android/ios) through which all functionality of Sunbird can be accessed.
Latest release- release-5.2.0
Ongoing release- release-6.0.0
Prerequisites: | Package | Version | Recommended Version |
---|---|---|---|
Node | 12+ | 12.22.10 | |
NPM | 6+ | 6.14.16 | |
Cordova | 10+ | 10.1.2 | |
Ionic | 5 | 5.7.0 | |
Java(For Android) | 11+ | 11.0.15.1 | |
Gradle(For Android) | 7+ | 7.0.2 | |
CocoaPods(For Ios) | 1.11.3 |
Project Setup
1. Ionic-Android build Setup
settings/appearance and behavior/system settings/Android SDK
~/.bashrc
or ~/.bash_profile
as followsexport ANDROID_SDK_ROOT=path_to_sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
Reference: https://ionicframework.com/docs/installation/android
CLI Setup
npm install -g ionic
npm install -g cordova
sunbird.properties.example
file to sunbird.properties
and put all the valid credentials and api endpoint. Run ./build.sh 3. Onboarding/Tabs Configuration Onboarding steps and Tabs can be configured via this configuration settings. Onboarding Configurations |
Name | Description | Options |
---|---|---|---|
Language Selection | User should select their prefered language | To skip language selection, set skip as false and provide default values | |
User Role Selection | User should select their role | If want to skip User Type selection, set skip as false and provide default user type | |
Profile Settings | User should set their profile by choosing their framework fields | Provide deafult profile values to skip profile settings page | |
District Maping | Here user need to provide details related to their location | To skip this page deafult location values are required |
{
"onboarding": [
{
"name": "language-setting",
"skip": false,
"default": {
"code": "en",
"label": "English"
}
}
]
}
{
"onboarding": [
{
"name": "user-type-selection",
"skip": false,
"default": "teacher"
}
]
}
{
"onboarding": [
{
"name": "profile-settings",
"skip": false,
"default": {
"syllabus": [
"CBSE"
],
"board": [
"cbse"
],
"medium": [
"english"
],
"grade": [
"class5",
"class6"
]
}
}
]
}
{
"onboarding": [
{
"name": "district-mapping",
"skip": false,
"default": {
"state": "Andaman & Nicobar Islands",
"stateId": "83h3u832ui4",
"district": "Nicobars",
"districtId": "aef899d41"
}
}
]
}
Tabs Page COnfigurations Configure the tabs page according to the requirement. Fllowing are the configurable settings for tabs.
{
"tabs": [
{
"root": "home",
"name": "home",
"icon": {
"active": "assets/imgs/tab_home_selected.svg",
"inactive": "assets/imgs/tab_home.svg",
"disabled": "assets/imgs/ic_home.png"
},
"label": "TAB_HOME",
"index": 2,
"isSelected": true,
"is_visable": true,
"disabled": false,
"theme": "NEW",
"status": "ALL",
"userTypeAdmin": true
}
]
}
Property | Description | Value |
---|---|---|
root |
On which page the tab should be shown. | home |
name |
Name given to the tab | home |
icon |
Different icons for respective events. i.e when the tab is selected, not seleted and disabled. | Object with path to the respectivr icons |
label |
Label name to displayed for the tab | 'TAB_NAME' |
index |
At which position the tab should be displayed | numeric value ex: 2 shows at 2 position in order |
isSelected |
Wheather the tab should be selected by deafult | Boolean value ex: true default selected |
is_visable |
To display the tab or not | Boolean value |
disabled |
If true , tab is displayed, but can't select |
Boolean. |
is_visable |
To display the tab or not | Boolean value |
theme |
Theme on which the tab should be displayed(If there are multiple theme for the app available) | name of theme for which tab has to be displayed |
status |
To display to a spefic user criteria | ex: 'logIn' will show to logged in users only |
userTypeAdmin |
Wheather to show for only Admin users | Boolean value |
4. How to build apk
adb devices
npm run ionic-build
(Make sure you have attached device) ionic cordova run android --prod
project_folder/platforms/android/app/build/outputs/apk/staging/debug/apk_name.apk
5. How to debug apk
chrome://inspect
npm i ionic@5.4.16 -g
npm i cordova@9.0.0 -g
npm install -g cordova-res
brew install ios-deploy
all of the above should be installed globally
Xcode 12.4 Build version 12D4e or above
NOTE: For M1 chipset users please go through FAQ section for ROSETA 2 compatibility and usage.1. Checkout sunbird-mobile-app repo from https://github.com/shikshalokam/SunbirdEd-mobile-app with branch release-3.9.0-ios
2. Add `GoogleService-Info.plist` file
3. cd to <sunbird-mobile-app> local path
4. Rename `sunbird.properties.example` file to `sunbird.properties` and put all the valid credentials and api endpoint.
5. RUN ./build-ios.sh
6. RUN cordova emulate ios
build-ios.sh
is completed, open platforms/ios/Sunbird.xcworkspace and run the application by clicking on Play buttonjavac --version
if you get the verdetails then it's installed already
Check the installation path in /Library/Java/JavaVirtualMachines
Check is JAVA_HOME is set by runnig echo $JAVA_HOME
, if you get the installation path as output then JAVA_HOME is set
For Further details follow the link - https://stackoverflow.com/a/50683158/4259981