call(){
CallNumber.callNumber(“321”, true)
.then(() => console.log(‘Launched dialer!’))
.catch(() => console.log(‘Error launching dialer’));
}
this is my code. but not launching the dailer
call(){
CallNumber.callNumber(“321”, true)
.then(() => console.log(‘Launched dialer!’))
.catch(() => console.log(‘Error launching dialer’));
}
this is my code. but not launching the dailer
1.- Add this plugin to your app’s module?
2.- real run devices platform ios/ android , no web
3.- Usage
import { CallNumber } from '@ionic-native/call-number';
constructor(private callNumber: CallNumber) { }
...
call(){
this.callNumber.callNumber("18001010101", true)
.then(() => console.log('Launched dialer!'))
.catch(() => console.log('Error launching dialer'));
}
<button ion-button color="light" outline (click)="call()">Light Outline</button>
import { NgModule, ErrorHandler } from ‘@angular/core’;
import { BrowserModule } from ‘@angular/platform-browser’;
import { IonicApp, IonicModule, IonicErrorHandler } from ‘ionic-angular’;
import { MyApp } from ‘./app.component’;
import { AboutPage } from ‘…/pages/about/about’;
import { ContactPage } from ‘…/pages/contact/contact’;
import { HomePage } from ‘…/pages/home/home’;
import { TabsPage } from ‘…/pages/tabs/tabs’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { CallNumber } from ‘@ionic-native/call-number’;
import { Contacts } from ‘@ionic-native/contacts’;
@NgModule({
declarations: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
providers: [
StatusBar,
SplashScreen,
CallNumber,
Contacts,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
i already added