how to use MessageUI framework to send iMessage me

2020-07-27 04:53发布

问题:

Is it possible to send messages from inside an app, using MessageUI framwork on iPhone?

Or, is there an URL Scheme for iMessage?

回答1:

With iOS 4.* you can send email and SMS from inside your app. Using the MessagUI viewController. Since iOS 5 is still under NDA we can not discus any new API's here

I've checked the documentatie and there is no mention of iMessage in there. Still the system might send the message via iMessage but you will not be notified about it.

The main reason for this is that iMessage is transparent in the system, it start out as the normal SMS application, and if the system detect that the other party also has iOS 5 it will switch to iMessage.



回答2:

The iMessage URL scheme on iPhone (still) appears to be sms:imessageid
where imessageid is the AppleID associated with iMessage or the phone number. This will work on iPhone but does not work with Messages on the (Mac) OS X.

The Messages URL scheme on MacOS X is 'imessage:imessageid' where imessageid is the AppleID associated with iMessage. This will launch the Messages App on OS X, but will not launch the iMessage App on iPhone. (I assume that the latter will also work on iPhone some day.)



回答3:

We can send messages and mails in our iPhone application using the MessageUI-framework. It is very simple to understand. See the MessageUI-framework reference for iOS.