4

我有兴趣在 iPhone 上的私人应用程序中发送彩信。我需要的很多信息都是专有的,因此我在任何地方都找不到。基本上,我正在寻找构建 CTMessage 并将其编码为 MMS 的正确方法,然后通过重载的 sendMMS 函数之一发送它。提前致谢。

4

1 回答 1

5

For those interested: here is what I managed to dig up (&/OR piece together myself).

For every MMS, a CTMessage is allocated & initialized. addRecipient/setRecipient is called to do just that.

For each data/text section a CTMessagePart is built with its data and corresponding datatype, and then added to the CTMessage's items array. The first item in each MMS items array is always a CTMessagePart containing a SMIL-formatted layout that the recipient interprets to display the message. Each CTMessagePart following the first is in the order that it is referenced from the SMIL data.

Each (unmodifiied) iPhone has an instance of CTMessageCenter running, with the id sharedMessageCenter. Calling sharedMessageCenter's sendMMS, giving the id of the CTMessage you just created will automate the rest of the process. Essentially, the CTMessage is encoded using the CTMmsEncoder into an MMS-PDU hex string. (Not to sure of the correct name for it, hah). Anyways, sharedMessageCenter's send method will then send the (encoded) MMS to your provider's MMSC.

That pretty much sums it up, and should give anyone looking to head down that path a good place to start depending on what they're doing. I can do my best to answer any questions.

于 2012-08-08T04:31:11.343 回答