From 94a5e6bec7192abe15c0120c5478b75bd0169994 Mon Sep 17 00:00:00 2001 From: maheedhar1998 Date: Sun, 1 Mar 2020 19:31:32 -0500 Subject: [PATCH] Update --- package-lock.json | 20 ++++++++++++++++++++ package.json | 5 ++++- src/app/app.module.ts | 4 +++- src/app/contacts/contacts2.module.ts | 3 ++- src/app/profile/profile.page.ts | 9 +++++++-- src/app/user-contact/user-contact.module.ts | 7 +++---- 6 files changed, 39 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index c409751b..92d946f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3781,6 +3781,21 @@ "protobufjs": "^6.8.6" } }, + "@ionic-native/call-number": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@ionic-native/call-number/-/call-number-5.22.0.tgz", + "integrity": "sha512-17KhhY1aA5GR/9ClckPUSxqj34/DTF2AhPt7TC5bVp3x8QejOre/JaEyGstepBW8WNXSikuWMuMbg843MambEQ==", + "requires": { + "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } + } + }, "@ionic-native/core": { "version": "5.15.1", "resolved": "https://registry.npmjs.org/@ionic-native/core/-/core-5.15.1.tgz", @@ -6011,6 +6026,11 @@ "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" }, + "call-number": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-number/-/call-number-1.0.1.tgz", + "integrity": "sha1-v52q5If9alVz+JqjZV++ivA2r9I=" + }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", diff --git a/package.json b/package.json index ebc40e18..f252225b 100644 --- a/package.json +++ b/package.json @@ -20,12 +20,14 @@ "@angular/platform-browser": "~8.1.2", "@angular/platform-browser-dynamic": "~8.1.2", "@angular/router": "~8.1.2", + "@ionic-native/call-number": "^5.22.0", "@ionic-native/core": "^5.0.0", "@ionic-native/facebook": "^5.20.0", "@ionic-native/qr-scanner": "^5.17.1", "@ionic-native/splash-screen": "^5.0.0", "@ionic-native/status-bar": "^5.19.1", "@ionic/angular": "^4.7.1", + "call-number": "^1.0.1", "cordova": "^9.0.0", "cordova-android": "^8.1.0", "cordova-browser": "6.0.0", @@ -96,7 +98,8 @@ "APP_NAME": "Connect :)", "FACEBOOK_HYBRID_APP_EVENTS": "false", "FACEBOOK_ANDROID_SDK_VERSION": "5.5.2" - } + }, + "mx.ferreyra.callnumber": {} }, "platforms": [ "android", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7a9a2f54..98f618e4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -11,6 +11,7 @@ import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; import firebaseConfig from '../../firebaseConfig' import * as firebase from 'firebase'; +import { CallNumber } from '@ionic-native/call-number/ngx'; @NgModule({ declarations: [AppComponent], @@ -20,7 +21,8 @@ import * as firebase from 'firebase'; StatusBar, QRScanner, SplashScreen, - { provide: RouteReuseStrategy, useClass: IonicRouteStrategy } + { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, + CallNumber ], bootstrap: [AppComponent] }) diff --git a/src/app/contacts/contacts2.module.ts b/src/app/contacts/contacts2.module.ts index a5e6f0c8..9b7680f3 100644 --- a/src/app/contacts/contacts2.module.ts +++ b/src/app/contacts/contacts2.module.ts @@ -20,6 +20,7 @@ const routes: Routes = [ IonicModule, RouterModule.forChild(routes) ], - declarations: [] + declarations: [], + exports: [ContactsPage] }) export class Contacts2PageModule {} diff --git a/src/app/profile/profile.page.ts b/src/app/profile/profile.page.ts index 196af381..0861e920 100644 --- a/src/app/profile/profile.page.ts +++ b/src/app/profile/profile.page.ts @@ -5,7 +5,7 @@ import { Router } from '@angular/router'; import * as backend from '../backendClasses'; import { PopoverController } from '@ionic/angular'; import { ContactsPage } from '../contacts/contacts.page'; -// import {hmTouchEvents} from ''; +import { CallNumber } from '@ionic-native/call-number/ngx'; @Component({ selector: 'app-profile', @@ -16,7 +16,7 @@ export class ProfilePage implements OnInit { private profile: backend.user; private firebase: FirebaseBackendService; private grid: {name: string, logo: string} [][] = []; - constructor(private router: Router, private popOver: PopoverController) { + constructor(private router: Router, private popOver: PopoverController, private callNum: CallNumber) { firebase.auth().onAuthStateChanged(firebaseUser => { if(!firebaseUser) { @@ -56,6 +56,11 @@ export class ProfilePage implements OnInit { }); return await pop.present(); } + call() { + this.callNum.callNumber(this.profile.getPhoneNumber, true).then( res => { + console.log("success"); + }); + } initGrid() { let names: string[] = this.getNames(); let logos: string[] = this.getLogos(); diff --git a/src/app/user-contact/user-contact.module.ts b/src/app/user-contact/user-contact.module.ts index 9286aaf5..58db0450 100644 --- a/src/app/user-contact/user-contact.module.ts +++ b/src/app/user-contact/user-contact.module.ts @@ -6,7 +6,7 @@ import { Routes, RouterModule } from '@angular/router'; import { IonicModule } from '@ionic/angular'; import { UserContactPage } from './user-contact.page'; -import { Contacts2PageModule } from '../contacts/contacts2.module'; +import { ContactsPage } from '../contacts/contacts2.module'; const routes: Routes = [ { @@ -23,9 +23,8 @@ const routes: Routes = [ RouterModule.forChild(routes) ], declarations: [ - UserContactPage, - Contacts2PageModule + UserContactPage ], - entryComponents: [Contacts2PageModule] + entryComponents: [ContactsPage] }) export class UserContactPageModule {}