Ionic Series--Send SMS

Source: Internet
Author: User

1. Requirements Description

Recently done projects need to have the ability to remind users that can call the phone to send SMS function

2. Preparation

①, add plugin $cordovasms

Cordova Plugin Add Https://github.com/cordova-sms/cordova-sms-plugin.git

②, adding dependencies to the controller

3. Code implementation
Texting $scope.sendmessage=function () {    //configuration    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         }    };     $cordovaSms          .send (' 18654332789 ',  ' sms content ', options)         &nBSP;. Then (function ()  {            // success!  SMS was sent             Commonjs.alertpopup ("Send SMS Success");         }, function (Error)  {             // an error occurred         });};
4, the attention point
It seems that a lot of things need to go to the official website to see the original code and documents, Ng-cordova documents are not complete, no introduction option How to configure, you can find some open source other plug-ins from GitHub. How to find other open source plug-ins to introduce

Https://github.com/cordova-sms/cordova-sms-plugin website address and introduction.


Ionic Series--Send SMS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.