jb ionic alpha module // experimental please dont use
npm install @justbe-ionic-angular/alpha
Ionic alpha have common code that includes :
1) Root Component
2) Sidenavigation
3) DeciderPage
4) Application Update
5) Auth
`
$3
This is the starting point, This component is passed to ionic module that is then the starting point
of ionic application.
`
Following are the task done by the root component:
1) Checks the alpha configurations and enable or disables the sidenav
2) Navigates to decider page
`
$3
`
Following are the tasks done by decider page
1) if application update configurations are provided it checks for application updates
2) if application updates are available then navigates to appUpdatePage.
3) Checks if user is already authenticated or not if yes, then navigates to home page, else navigates to auth page
`
$3
This page is opened if update is vailable and then playstore or appstore is opened according to your
platform$3
This is the wrapper page to which you can pass your component which can be shown on sidenav$3
`
There are three way by which you can loggedin in to the application
1) Facebook
2) Google
3) Mobile OTP
`
Installation
Use the node package manager npm to install @justbe-ionic-angular/alpha.
`bash
npm install @justbe-ionic-angular/alpha --save
`
Usage
$3
`typescript
import { NgModule } from '@angular/core';
import { AlphaModule, RootComponent } from '@justbe-ionic-angular/alpha';
@NgModule({
declarations: [
..
],
imports: [
..,
IonicModule.forRoot(RootComponent, {
..,
tabsHideOnSubPages: true,
backButtonText: '',
..,
}),
AlphaModule,
..,
]
})
export class AppModule { }
`$3
`typescript
import { Component } from '@angular/core';
import { AlphaService } from "@justbe-ionic-angular/alpha";
import { HomePage, SliderPage, SidenavPage } from "../path/to/your/pages"
@Component({
templateUrl: 'root.component.html'
})
export class RootComponent {
..
constructor(
..,
private alphaService: AlphaService,
..
){}
this.alphaService.setConfigurations({
endPoint: AppConfig.API_ENDPT,
type: 'api',
ifAlreadyLoggedIn: { klass: HomePage },
sliderConfigurations: { klass: SliderPage },
sidenavConfigurations: { klass: SidenavPage },
authConfigurations: { afterLoginSuccess: { klass: HomePage } },
appUpdateConfigurations: {
appName: AppConfig.APP_NAME,
appVersion: AppConfig.APP_VERSION,
cfEndPoint: AppConfig.CF_API_ENDPT,
playstoreUrl: "market://details?id=com.beyoutech.one.louve.coach",
itunesUrl: "itms-apps://itunes.apple.com/app/id1418392416"
}
})
}
``cordova plugin need to be install manually
ionic cordova plugin add cordova-plugin-app-preferences
this will automatically included as it is in dependency
npm install --save @ionic-native/app-preferences@4