Software Archive
Read-only legacy content
17061 Discussions

Cannot send SMS

Nick_F_2
New Contributor III
968 Views

Hi

I'm trying to send an SMS message but get this error in the console after calling intel.xdk.device.sendSMS

Uncaught Error: AppMobi.device.sendSMS: Not available in the Intel XDK 

0 Kudos
5 Replies
John_H_Intel2
Employee
968 Views

I believe that API call is not available in the XDK. You need to include the Intel Device plugin, then either build your app or test it with App Preview.

0 Kudos
Nick_F_2
New Contributor III
968 Views

I have the XDK Device plugin installed. I have also tried the Cordova device plugin and neither work.

0 Kudos
Swapnil_Joshi
Beginner
968 Views

To send SMS you can use  Featured & Custom cordova plugins

step 1 :  go to plugins -> Featured & Custom cordova plugins -> select Device*  Plugin

step 2 :  Try This code     

       var bodyText = 'I am at XYZ if you want to join me';

  intel.xdk.device.sendSMS(bodyText, "7175551234");

  It will open built in application for sending SMS.

OR

step 1 : go to plugins -> Featured & Custom cordova plugins -> select SocialSharing*  Plugin

step 2 : Use  window.plugins.socialsharing.shareViaSMS(  ' Message ', '1234567890' ); 

0 Kudos
Michael_O_
Beginner
968 Views

Dear Nick,

You can send SMS with this code "

var bodyText = 'I am at XYZ if you want to join me';            
intel.xdk.device.sendSMS(bodyText, "234806311234");

Ensure that you have the "device" option selected under "Featured and custom Cordova plugins".

There is no need for an extra plugin.

"

0 Kudos
Michael_O_
Beginner
968 Views
function SendSMS(){
var bodyText = 'I am at XYZ if you want to join me';            
intel.xdk.device.sendSMS(bodyText, "7175551234");
}
<button onclick="SendSMS();">SEND</button>

See the codes above.

 

0 Kudos
Reply