Joke Collection Website - Public benefit messages - How to use the system's MFMessageComposeViewController to send short messages?
How to use the system's MFMessageComposeViewController to send short messages?
How to use the system message to send SMS 1, and import the package MessageUI.framework2, the main content (1). Code topic part mfmessagecomposer controller * controller = [[mfmessagecomposer controller] init]; //Before presenting the message composition view, call the canSendText class method to ensure that the user's device configuration is correct. If ([mfmessagecompositeviewcontrollercan send text]) {//message controller. body = the initial content of message; //An array of strings containing the initial recipients of the message. Controller.recipients = substring; //Proxy method controller. MessageCompositedelegate = self [self presentmodalviewcontroller: controller animation: Yes]; (2) Execute the proxy method//Tell the entrusting user that the message has been written-(Void) Message Composer Controller: (mfmessage composer controller *) Controller Diffinishwith Result: (Message ComposeResult) Result {[SelfdismModelViewControllerAnimated: Yes]; If (result = = Message Composed Resulted) nslog (@ "Message cancelled"); else if(result = = MessageComposeResultSent)NSLog(@“Message sent”); Else NSLog(@ "Message Failed"); } Summary: (1) Before sending short messages, it is necessary to verify whether the device has the ability to send short messages. (2) Attribute message is the content of short message. (3) The attribute menu is the sender information of short messages. Please note that its type is nsarray2013-01-02 Shangdao.
- Previous article:Confirm the content of the message before the bank interview.
- Next article:How to synchronize SMS from Android phone to Apple phone?
- Related articles
- Changle ZTO Express Phone Number
- Classic riddle short message
- Ancient Chinese New Year greetings
- How to send emails on Sina Weibo
- Does the telecom company have to spend money to distribute packages every day?
- How to find deleted messages?
- 202 1-2022 enterprise annuity online inquiry system (with inquiry steps)
- What if you are blackmailed by the Internet?
- Warm-hearted sentences to say good morning to lovers; Examples of warm-hearted sentences in Good Morning to Lovers.
- The outline of a sentence.