@@ -4,6 +4,7 @@ | |||
"bundledWebRuntime": false, | |||
"npmClient": "npm", | |||
"webDir": "www", | |||
"linuxAndroidStudioPath": "/home/kj1352/android-studio/android-studio/bin/studio.sh", | |||
"plugins": { | |||
"SplashScreen": { | |||
"launchShowDuration": 0 | |||
@@ -1797,6 +1797,14 @@ | |||
} | |||
} | |||
}, | |||
"@ionic-native/android-full-screen": { | |||
"version": "5.32.1", | |||
"resolved": "https://registry.npmjs.org/@ionic-native/android-full-screen/-/android-full-screen-5.32.1.tgz", | |||
"integrity": "sha512-UIA2sAYYr9GMp+TBXxJ/0E97XpKkAvtJLb8jOz/ckyRa2MvxgrFTIU3KAyh2/vKoSjDxegvjelZil+1tgH18hA==", | |||
"requires": { | |||
"@types/cordova": "^0.0.34" | |||
} | |||
}, | |||
"@ionic-native/app-version": { | |||
"version": "5.32.0", | |||
"resolved": "https://registry.npmjs.org/@ionic-native/app-version/-/app-version-5.32.0.tgz", | |||
@@ -4729,6 +4737,11 @@ | |||
"resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz", | |||
"integrity": "sha512-m7cughw327CjONN/qjzsTpSesLaeybksQh420/gRuSXJX5Zt9NfgsSbqqKDon6jnQ9Mm7h7imgyO2uJ34XMBtA==" | |||
}, | |||
"cordova-plugin-fullscreen": { | |||
"version": "1.3.0", | |||
"resolved": "https://registry.npmjs.org/cordova-plugin-fullscreen/-/cordova-plugin-fullscreen-1.3.0.tgz", | |||
"integrity": "sha512-K0SQMUyemQrezNlnfyHXQd8BgpwR3TS/fx456GueRCUdro5QG6tCzDDVBCVEGeKroDhXWmabAlhvO3gPoqw/tg==" | |||
}, | |||
"cordova-plugin-ionic-keyboard": { | |||
"version": "2.2.0", | |||
"resolved": "https://registry.npmjs.org/cordova-plugin-ionic-keyboard/-/cordova-plugin-ionic-keyboard-2.2.0.tgz", | |||
@@ -29,6 +29,7 @@ | |||
"@capacitor-community/facebook-login": "^2.0.0", | |||
"@capacitor/android": "^2.4.7", | |||
"@capacitor/core": "2.4.7", | |||
"@ionic-native/android-full-screen": "^5.32.1", | |||
"@ionic-native/app-version": "^5.32.0", | |||
"@ionic-native/core": "^5.0.0", | |||
"@ionic-native/http": "^5.32.0", | |||
@@ -39,6 +40,7 @@ | |||
"cordova-plugin-advanced-http": "^3.1.0", | |||
"cordova-plugin-app-version": "^0.1.12", | |||
"cordova-plugin-file": "^6.0.2", | |||
"cordova-plugin-fullscreen": "^1.3.0", | |||
"cordova-plugin-x-socialsharing": "^6.0.3", | |||
"cordova-res": "^0.15.3", | |||
"es6-promise-plugin": "^4.2.2", | |||
@@ -3,6 +3,7 @@ import { Component } from '@angular/core'; | |||
import { Platform } from '@ionic/angular'; | |||
import { SplashScreen } from '@ionic-native/splash-screen/ngx'; | |||
import { StatusBar } from '@ionic-native/status-bar/ngx'; | |||
import { AndroidFullScreen } from '@ionic-native/android-full-screen/ngx'; | |||
@Component({ | |||
selector: 'app-root', | |||
@@ -15,7 +16,8 @@ export class AppComponent { | |||
constructor( | |||
private platform: Platform, | |||
private splashScreen: SplashScreen, | |||
private statusBar: StatusBar | |||
private statusBar: StatusBar, | |||
private androidFullScreen: AndroidFullScreen | |||
) { | |||
this.initializeApp(); | |||
} | |||
@@ -24,9 +26,8 @@ export class AppComponent { | |||
this.platform.ready().then(() => { | |||
this.statusBar.styleDefault(); | |||
this.splashScreen.hide(); | |||
localStorage.isPartyChatOn = 'no'; | |||
this.androidFullScreen.isImmersiveModeSupported().then(() => this.androidFullScreen.immersiveMode()); | |||
}); | |||
} | |||
} |
@@ -8,6 +8,7 @@ import { StatusBar } from '@ionic-native/status-bar/ngx'; | |||
import { HTTP } from '@ionic-native/http/ngx'; | |||
import { SocialSharing } from '@ionic-native/social-sharing/ngx'; | |||
import { AppVersion } from '@ionic-native/app-version/ngx'; | |||
import { AndroidFullScreen } from '@ionic-native/android-full-screen/ngx'; | |||
import { AppRoutingModule } from './app-routing.module'; | |||
import { AppComponent } from './app.component'; | |||
@@ -36,6 +37,7 @@ import { UserService } from './services/user.service'; | |||
SplashScreen, | |||
SocialSharing, | |||
AppVersion, | |||
AndroidFullScreen, | |||
NewsService, | |||
MatchService, | |||
UserService, | |||
@@ -53,7 +53,7 @@ export class FacebookLoginComponent implements OnInit { | |||
} else { | |||
this.hideAll = true; | |||
} | |||
} | |||
} | |||
async login() { | |||
@@ -82,14 +82,6 @@ export class FacebookLoginComponent implements OnInit { | |||
if (result.accessToken) { | |||
this.token = result.accessToken; | |||
this.loadUserData(); | |||
localStorage.setItem('FBToken', JSON.stringify(this.token)); | |||
this.userService.getUserProfile().then((data) => { | |||
localStorage.setItem('ServerUserData', JSON.stringify(data)); | |||
}, err => alert(JSON.stringify(err))); | |||
} else { | |||
// Not logged in. | |||
} | |||
@@ -104,18 +96,23 @@ export class FacebookLoginComponent implements OnInit { | |||
console.log(JSON.stringify(err)); | |||
alert("Falied to fetch user data"); | |||
}); | |||
localStorage.setItem('FBToken', JSON.stringify(this.token)); | |||
this.userService.getUserProfile().then((data) => { | |||
localStorage.setItem('ServerUserData', JSON.stringify(data)); | |||
}, err => alert(JSON.stringify(err))); | |||
} | |||
async logout() { | |||
await this.fbLogin.logout().then(() => { | |||
console.log("Logged Out"); | |||
this.user = null; | |||
this.token = null; | |||
localStorage.removeItem('FBUser'); | |||
localStorage.removeItem('FBToken'); | |||
localStorage.removeItem('ServerUserData'); | |||
App.exitApp(); | |||
}, (err) => alert(JSON.stringify(err))); | |||
this.user = null; | |||
this.token = null; | |||
localStorage.removeItem('FBUser'); | |||
localStorage.removeItem('FBToken'); | |||
localStorage.removeItem('ServerUserData'); | |||
App.exitApp(); | |||
} | |||
} |