Commit 10305861 by Adarsh K

Merge branch 'adarsh' into 'master'

Adarsh See merge request !20
parents 71476a01 5689a94c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>949385251610-a6lrfr6uhr73991e38t3t013jj3v56a9.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.949385251610-a6lrfr6uhr73991e38t3t013jj3v56a9</string>
<key>ANDROID_CLIENT_ID</key>
<string>949385251610-kmvonuqfdq5fnltoflke15m0i1pck44n.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyAuEm0tmKdm3whaqO80I2BmQ76Fc-vPUKc</string>
<key>GCM_SENDER_ID</key>
<string>949385251610</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.getmi.customer</string>
<key>PROJECT_ID</key>
<string>getmi-4fd26</string>
<key>STORAGE_BUCKET</key>
<string>getmi-4fd26.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:949385251610:ios:951ba19e173de284483aa3</string>
<key>DATABASE_URL</key>
<string>https://getmi-4fd26.firebaseio.com</string>
</dict>
</plist>
\ No newline at end of file
{
"project_info": {
"project_number": "949385251610",
"firebase_url": "https://getmi-4fd26.firebaseio.com",
"project_id": "getmi-4fd26",
"storage_bucket": "getmi-4fd26.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:949385251610:android:0afdeb32b3973868483aa3",
"android_client_info": {
"package_name": "com.getmi.customer"
}
},
"oauth_client": [
{
"client_id": "949385251610-kmvonuqfdq5fnltoflke15m0i1pck44n.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.getmi.customer",
"certificate_hash": "1e4dcbaadd3e2b90b93b36ae0b4b09f72e770a26"
}
},
{
"client_id": "949385251610-lr7ga8c9rvu4qhsqassaqsq3l58g8qua.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCfj5l5fCxSGhabuw502k9VMnfy5nKHMPI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "949385251610-lr7ga8c9rvu4qhsqassaqsq3l58g8qua.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
......@@ -1471,6 +1471,11 @@
"@types/cordova": "^0.0.34"
}
},
"@ionic-native/google-plus": {
"version": "5.0.0-beta.0",
"resolved": "https://registry.npmjs.org/@ionic-native/google-plus/-/google-plus-5.0.0-beta.0.tgz",
"integrity": "sha512-YEV8Br1vWN3jLFQ8qIYOEAGqvd13f63brRfSf1EhFG2uvR3iLH6rJ2LfGrr4BUmczgdi1NDzMSpwVSK80xPffg=="
},
"@ionic-native/native-geocoder": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@ionic-native/native-geocoder/-/native-geocoder-5.0.0.tgz",
......@@ -3490,6 +3495,21 @@
"resolved": "https://registry.npmjs.org/cordova-plugin-geolocation/-/cordova-plugin-geolocation-4.0.2.tgz",
"integrity": "sha512-QGThnPKzPxESHkruZlpE0+5aFBVOet8al0vIJ7laSUOQHIC1dd/JY6peVIbtLboKi5Dap1wCKRubOqPqH8xcQA=="
},
"cordova-plugin-googleplus": {
"version": "8.1.2",
"resolved": "https://registry.npmjs.org/cordova-plugin-googleplus/-/cordova-plugin-googleplus-8.1.2.tgz",
"integrity": "sha512-YQEgFQb4s5zd3xTDrWvYEUDc8uMl9W57WNg82ZSj/QjkLw0QOPUygszQXRg6H2RAbN3GI/sVAPmIvMoIFpXp7w==",
"requires": {
"q": "^1.5.1"
},
"dependencies": {
"q": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc="
}
}
},
"cordova-plugin-ionic-keyboard": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/cordova-plugin-ionic-keyboard/-/cordova-plugin-ionic-keyboard-2.1.3.tgz",
......
......@@ -25,6 +25,7 @@
"@angular/router": "~8.1.2",
"@ionic-native/core": "^5.0.0",
"@ionic-native/geolocation": "^5.0.0",
"@ionic-native/google-plus": "^5.0.0-beta.0",
"@ionic-native/native-geocoder": "^5.0.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.12.0",
......@@ -34,6 +35,7 @@
"cordova-android": "^8.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-geolocation": "4.0.2",
"cordova-plugin-googleplus": "^8.1.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^4.1.1",
"cordova-plugin-nativegeocoder": "3.2.2",
......@@ -88,7 +90,10 @@
"GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
},
"cordova-plugin-nativegeocoder": {},
"cordova-sqlite-storage": {}
"cordova-sqlite-storage": {},
"cordova-plugin-googleplus": {
"REVERSED_CLIENT_ID": "com.googleusercontent.apps.949385251610-a6lrfr6uhr73991e38t3t013jj3v56a9"
}
},
"platforms": [
"android"
......
......@@ -7,6 +7,7 @@ import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { IonicStorageModule } from '@ionic/storage';
import { GooglePlus } from '@ionic-native/google-plus/ngx';
......@@ -46,7 +47,8 @@ import { DeliverypopPageModule} from './deliverypop/deliverypop.module';
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
ServiceService,
AuthService
AuthService,
GooglePlus
],
bootstrap: [AppComponent]
})
......
......@@ -41,7 +41,7 @@ export class LandingPage implements OnInit {
goToPage(path, data = null) {
this.service.set('landing', true);
this.router.navigateByUrl(path, {replaceUrl: true});
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......
......@@ -29,10 +29,10 @@
</div>
<div class="row">
<div class="social_div">
<div class="social_btn" style="border-right:1px solid rgba(215, 213, 228, 1);" (click)="presentModal()">
<div class="social_btn" style="border-right:1px solid rgba(215, 213, 228, 1);" (click)="authService.facebook()">
Facebook
</div>
<div class="social_btn">
<div class="social_btn" (click)="authService.google()">
Google
</div>
</div>
......
......@@ -5,6 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
import { AngularFireAuth } from '@angular/fire/auth';
import { AngularFirestore, AngularFirestoreDocument } from '@angular/fire/firestore';
import { ServiceService } from './../config/service.service';
import { GooglePlus } from '@ionic-native/google-plus/ngx';
import { from } from 'rxjs';
@Injectable({
......@@ -17,7 +18,8 @@ export class AuthService {
public afs: AngularFirestore,
public afAuth: AngularFireAuth,
private router: Router,
private service: ServiceService
private service: ServiceService,
private googlePlus: GooglePlus
) {
this.afAuth.authState.subscribe(user => {
if (user) {
......@@ -42,6 +44,22 @@ export class AuthService {
});
}
public async google() {
// this.googlePlus.login({}).then(res => console.log(res)).catch(err => console.error(err));
this.afAuth.auth.signInWithPopup(new auth.GoogleAuthProvider()).then((result) => {
console.log('success');
console.log(result);
});
}
public async facebook() {
this.afAuth.auth.signInWithPopup(new auth.FacebookAuthProvider()).then((result) => {
console.log('success');
console.log(result);
});
}
get isLoggedIn(): boolean {
const user = JSON.parse(localStorage.getItem('user'));
return (user !== null && user.emailVerified !== false) ? true : false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment