Ionic 2 SMS is not working


#1

.ts code is bellow

import { Component } from '@angular/core';
import { NavController,ToastController } from 'ionic-angular';
import { SMS } from '@ionic-native/sms';


@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
number: string = "";
message: string = "";

  constructor(public navCtrl: NavController,public sms: SMS,private toastCtrl: ToastController) {

  }
sendTextMessage() {
    this.sms.send(this.number, this.message).then((result) => {
      let successToast = this.toastCtrl.create({
        message: "Text message sent successfully! :)",
        duration: 3000
      })
      successToast.present();
    }, (error) => {
      let errorToast = this.toastCtrl.create({
        message: "Text message not sent. :(",
        duration: 3000
      })
      errorToast.present();
    });
 }

}

HTML code is bellow

<ion-content padding>
  <ion-card>
    <ion-item>
      <ion-label stacked>Phone Number</ion-label>
      <ion-input [(ngModel)]="number" type="text"></ion-input>
    </ion-item>
 
    <ion-item>
      <ion-label stacked>Message</ion-label>
      <ion-textarea [(ngModel)]="message"></ion-textarea>
    </ion-item>
 
    <ion-item>
      <button ion-button icon-left clear item-right (click)="sendTextMessage()">
      <ion-icon name="checkmark"></ion-icon>
      Send
    </button>
    </ion-item>
  </ion-card>
</ion-content>

Not getting any SMS, and bellow dependency for SMS

"@ionic-native/sms": "^4.2.1",

#2

Did you resolve this issue. I’ve same issue except that my app crashes when I try to send SMS without intent which is what I want.