IOS program development of the jump SMS send interface to achieve the function of sending SMS _ios

Source: Internet
Author: User

Project requirements: In the program development, we need to send some SMS validation in a program (not to receive SMS verification, SMS verification, transmission door: http://www.cnblogs.com/wolfhous/p/5096774.html

Project implementation:

New demo, directly to see my source code signs.


Source screenshot


Real Machine screenshot


It is so simple, if you have any questions/suggestions or better ways to achieve, contact me.

Can see my folded source code

/** Click send SMS Button * *-(Ibaction) Sendmessagebut: (ID) Sender {/** If the text message can be sent (not in the emulator case * * [Mfmessagecomposeviewcontroller
Cansendtext]) {/** Create SMS Interface (Controller */Mfmessagecomposeviewcontroller *controller = [Mfmessagecomposeviewcontroller new]; controller.recipients = @[self.phonetextfield.text];//SMS recipient is a nsarray array controller.body = self.messagebody.text;//
SMS Content controller.messagecomposedelegate = self;//Set agent, Agent is not controller.delegate = self OH!!!
/** Cancel button Color (incidental, can not write) * * Controller.navigationBar.tintColor = [Uicolor Redcolor];
[Self Presentviewcontroller:controller animated:yes completion:nil];
}else{NSLog (@ "Emulator does not support sending SMS");} #pragma mark-mfmessagecomposeviewcontrollerdelegate/** * Protocol method, call (e.g. click Send, Cancel send, send failure) when the information interface finishes processing the information result @param controller Information Controller * @param result return of the information sent to the success of the status * * * (void) Messagecomposeviewcontroller: (Mfmessagecomposeviewcontroller *) Controller didfinishwithresult: (messagecomposeresult) result {/** Send the message back to the original program * * [Self dismissviewcontrolleranimated:
YES Completion:nil]; Switch (resUlt) {case Messagecomposeresultsent:nslog (@ "send success"); break, Case Messagecomposeresultfailed:nslog (@ "send failed");
Case Messagecomposeresultcancelled:nslog (@ "send Cancel");
Default:break; }
}

The above is the introduction of the iOS program to introduce the development of the SMS to send the text of the interface to send the full description of the function, I hope you like.

Related Article

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.