I installed https://ionicframework.com/docs/native/sms for sending SMS from the IONIC app. The following is my implementation:
sendSMS(phoneNumber: string, text: string, event) {
this.sms.send(String(phoneNumber), text).then(result => {
console.log(result);
}).catch(error => {
console.log(error);
});
}
I am testing this on an iOS physical device. When I click on the button to send an SMS for the first time after a fresh installation, it takes up to 30 seconds to load, but after that, it happens instantly. Even after closing the application, and restarting the phone. I looked into the Log and found:
file:xxxx/ios/capacitor-cordova-ios-plugins/sources/CordovaSmsPlugin/Sms.m: runtime: UI API called from background thread: -[UIViewController init] must be used from main thread only
Angular version 11, IONIC version 5.31.1, SMS ionic-native/sms": "^5.31.1", "cordova-sms-plugin": "^1.0.0"