I wan't write app może wywoływać po numerze wprowadzonym przez użytkownika.Ionic 2-call number not working
Ale używam http://ionicframework.com/docs/v2/native/callnumber/ to nie działa.
to mój kod ts
import { Component } from '@angular/core';
import {CallNumber} from 'ionic-native';
import { Platform, ActionSheetController } from 'ionic-angular';
// import { NavController } from 'ionic-angular';
declare var window;
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(
public platform: Platform,
public actionsheetCtrl: ActionSheetController
) { }
strShowInHtml = "";
callIT(){
// window.location = '12345';
CallNumber.callNumber("12345", true)
.then(() =>{
console.log('Launched dialer!');
this.strShowInHtml="ok";
})
.catch(() => {
console.log('Error launching dialer');
this.strShowInHtml="error";
});
}
}
i mój kod html:
<ion-header>
<ion-navbar>
<ion-title>Action Sheets</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding class="action-sheets-basic-page">
<button md-button (click)="callIT()">callIT</button>
</ion-content>
wiem, że mogę używać
<a ion-button href="tel:+0839504890">Call me 1 </a>
ale nie chcę go używać, beaucase przejdzie do widoku Call Phone. Chcę kliknąć przycisk, a moja aplikacja Ionic 2 zadzwoni pod numer użytkownika.
Ta wtyczka https://github.com/Rohfosho/CordovaCallNumberPlugin nie działa –