I have installed cordova-plugin-sms and it’s giving me plugin_not_installed issue while running app in android device
Did you install
@ionic-native/sms
as well?
ionic cordova plugin add cordova-sms-plugin
npm install --save @ionic-native/sms
see here for details
yes i have installed @ionic/sms
but while installing cordova-sms-plugin it gives error
so i have installed cordova-pluing-sms
I followed the instructions and installed both packages.
But I hit the same problem on iPhone.
with @ionic-native/sms 4.0.1, cordova-sms-plugin 0.1.11
Do you get any other messages? I used it successfully in my code with the following setup:
package.json ==>
"cordova-sms-plugin": "^0.1.11",
"@ionic-native/sms": "^3.8.0",
The code itself:
sendSms() {
let options = {
replaceLineBreaks: true, // true to replace \n by a new line, false by default
android: {
intent: ‘INTENT’ // send SMS with the native android SMS messaging
//intent: ‘’ // send SMS without open any other app
}
};
let textToSend = “this is just a test”;
this.sms.send(‘123123123’, textToSend, options).then(whatever => {
this.resetStatusBar();
}).catch(() => {
this.resetStatusBar();
})
the import:
import {SMS} from “@ionic-native/sms”;
Hope it helps!
Ah btw. did you add it to your provides in app.module.ts
?
Like this:
@NgModule({
providers: [
/** … /
SMS
/ … **/
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
I have added in providers
I do not get other messages because I can get from the catch only.
What errors are you getting?
Why do you think just installing a different plugin might work?
Also “cordova-pluing-sms” seems not like a valid plugin name.
I think I have found the problem.
Because I am using ionic view and sms plugin is not supported in ionic view
https://docs.ionic.io/tools/view/#supported-plugins