开发者

iPhone In-App SMS MFMessageComposeViewController Auto-Send

开发者 https://www.devze.com 2023-01-14 13:27 出处:网络
I am using Apple\'s documented methods for In-App SMS today (MFMessageComposeViewController Class Reference)

I am using Apple's documented methods for In-App SMS today (MFMessageComposeViewController Class Reference)

This shows a Compose Message dialog box with the recipients and the body (optionally) pre-filled. However, the user still has to push the send button.

The App, Vlingo, seems to have figured out a way to programmatically send from the composer dialog box. They pop a countdown alert (non-standard) when the ModalViewController (MFMessageComposeViewController) is di开发者_StackOverflowsplayed. After 3 seconds, the message is automatically sent and the view dismissed. I have posted a screenshot of this here.

Any thoughts on how they accomplished this?


My guess is they are adding an OverlayViewController on top of the MFMessageComposeViewController and then they are programmatically calling touch event on that overlayViewController which is transferred to the modal view controller and the send button is pressed.. when the user presses "edit" on the overlayViewController, they just remove the overlayViewController so the user now has direct access to the modal view (i.e. MFMessageComposeViewController), and then the user will press the send button manually..


The MFMessageComposeViewController just posts back it's sent status to the delegate:

messageComposeViewController:didFinishWithResult:

I think their overlay must be custom code. It might be the case that they aren't using Apple's classes and are just sending directly to their own server.


I just did some digging into the Vlingo app. They are replicating the look and feel of the native SMS app, and sending the text to the server over the internet.

There is no way to auto-send using the built-in SMS functionality without using private APIs.

0

精彩评论

暂无评论...
验证码 换一张
取 消