import { Component } from '@angular/core' ; import { PopoverController } from 'ionic-angular' ; import { PopoverPage } from '../popover/popover' ; import { CallNumber } from '@ionic-native/call-number' ; import { SocialSharing } from '@ionic-native/social-sharing' ; @ Component ( { selector : 'page-about' , templateUrl : 'about.html' } ) export class AboutPage { conferenceDate = '2047-05-17' ; constructor ( public popoverCtrl , private call , private socialSharing ) { } presentPopover ( event ) { let popover = this . popoverCtrl . create ( PopoverPage ) ; popover . present ( { ev : event } ) ; } callNow ( ) { this . call . callNumber ( "+919989887765" , true ) . then ( ( ) => console . log ( 'Launched dialer!' ) ) . catch ( ( ) => console . log ( 'Error launching dialer' ) ) ; } shareViaFacebook ( ) { this . socialSharing . canShareVia ( "facebook" , "Veloice:Intelligent Business Telephony" , "Real time Voice" , "http://veloice.com/images/banner.png" , "http://veloice.com" ) . then ( ( ) => { this . socialSharing . shareViaFacebook ( "Veloice:Intelligent Business Telephony" , "http://veloice.com/images/banner.png" , "http://veloice.com" ) ; } ) . catch ( ( ) => { alert ( "Cannot share on Facebook" ) ; } ) ; } shareViaWhatsApp ( ) { this . socialSharing . canShareVia ( "whatsapp" , "Veloice:Intelligent Business Telephony" , "Real time Voice" , "http://veloice.com/images/banner.png" , "http://veloice.com" ) . then ( ( ) => { this . socialSharing . shareViaWhatsApp ( "Veloice:Intelligent Business Telephony" , "http://veloice.com/images/banner.png" , "http://veloice.com" ) ; } ) . catch ( ( ) => { alert ( "Cannot share on Whatsapp" ) ; } ) ; } shareViaEmail ( ) { this . socialSharing . canShareViaEmail ( ) . then ( ( ) => { this . socialSharing . shareViaEmail ( 'Veloice:Intelligent Business Telephony' , 'Veloice' , [ 'toperson@xyz.com' , 'tosecond@xyz.com' ] , [ 'cc@xyz.com' ] , null , [ 'http://veloice.com/images/banner.png' ] ) ; } ) . catch ( ( ) => { alert ( "Cannot share on Email" ) ; } ) ; } share ( ) { this . socialSharing . share ( "Veloice:Intelligent Business Telephony" , "Real time Voice" , "http://veloice.com/images/banner.png" , "http://veloice.com" ) ; } updateFeed ( refresher ) { setTimeout ( ( ) => { console . log ( 'Async operation has ended' ) ; refresher . complete ( ) ; } , 2000 ) ; } }