Cordova sms plugin not working


#1

im actualy developping an app using ionic in which i must send sms to the new user containing an activation code in order to confirm his registration.

im using cordova sms plugin, and i tested it into many android version and also in windows phone 8 using phonegap developper but nothing is happening. My code is this one:

document.addEventListener(“deviceready”, function(){
//trying sms
$scope.smsTry = function(loginForm){

    if(loginForm.$valid){

        //CONFIGURATION
        var options = {
            replaceLineBreaks: true, // true to replace \n by a new line, false by default
            android: {
                intent: '' // send SMS without open any other app
            }
        };

        $cordovaSms.send($scope.signUpInfo.phoneNumber, 'This is some dummy text', options)
        .then(function(){
            $ionicPopup.alert({
                title: "Ok",
                template: "Xa a marcher"
            });
        }, function(error){
            $ionicPopup.alert({
                title: "Error",
                template: "putain"+error
            });

        });
    }
}

});


#2

What is this?
Does it include the plugin?


#3

Yes, i installed the plugin like the doc says. other plugins work
perfectly (cordova datepicker, and phonegap barcodescanner). but the
sms plugin doesnt work


#4

Please reread my question and reply to it. I have no idea what “phonegap developper” is. Normally a developer is a person.


#5

phonegap developper is a tool that can be download in the store and installed in a real device(android, wp, iOS) and allow to remotely debug a cordova application from the PC with the command ionic serve or phonegap serve. I use it only on my windows phone because i dont have the windows phone SDK in my PC. I only have the SDK for android but even with windows phone or android the plugin doesnt work(On android i use the command ionic build android --device and run it)

image


#6

Ah, so you are talking about: https://phonegap.com/products/

Seems the SMS plugin is not supported:
http://docs.phonegap.com/references/developer-app/troubleshoot-faq/


#7

the problem is that its not also working with a real android device having android 5.1.1 as version


#8

How are you building the app?
What is your ionic info output?


#9

Cordova CLI: 6.4.0
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.2.1
Xcode version: Not installed


#10

Dear Sujan I have change the scope $scope.signUpInfo.phoneNumber because before i was including the zipcode of the receiver but now i see the the success callback message but the application crash and close itself after and no message is sent! the receiver sim card is in another phone and the app that send is also in another phone.