Search code examples
ionic-frameworkcordova-plugins

not sending sms more than ones


I am trying to send to group of people sms but I can see that sms send to only one person... My code is:

   var options = {
          replaceLineBreaks: false, // 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
          }
        };

        var success = function () { alert('Message sent successfully'); };
        var error = function (e) { alert('Message Failed:' + e); };
        sms.send(['0544462095',.........,'0547549701'],
          $scope.sms.context, options, success, error);

I am using ionic 1 and cordova 6+, any idea whey?


Solution

  • You can't do that. You can only specify multiple phone numbers with intent: 'INTENT' to start a MMS. In your case you have to iterate over you array of phonenumbers and call $cordovaSms.send() each time.