Dev:ChatKit.framework

ChatKit is a framework designed for handling SMS, iMessage and MMS, and the views for these. iMessage was introduced in iOS 5 under the codename CKMadridService but has since been replaced and fully integrated into ChatKit.

Listener Capabilities
As of iOS 7, things a process can do with this framework is limited by imagent, the backend daemon that processes calls from ChatKit.framework. Imagent uses a property called listener capabilities to determine what each process can do.

Default Values for Some Common Processes
 com.apple.springboard Status, Notifications, Accounts, Modify Read State, Chat Counts com.apple.MobileSMS Status, Notifications, Chats, Transfers, Accounts, ID Queries 

Reading a Message
First things first: When I speak about iMessage I include SMS as well.

ChatKit performs some actions when a message is read, but you as a Tweak developer can do even more.

When you read a message in the iMessage App, the notification CKConversationMessageReadNotification is posted.

We can simply listen to this notification using

So whenever the notification is posted, we can control it in the -(void)readAwesomeMessage:(NSNotification *)notification; method.

By looking at the NSNotification documentation we can see that every NSNotification object has an -(NSDictionary *)userInfo method that returns information which was sent with the notification. This method can return NULL if there is no information available.

From my findings I can say that the userInfo dictionary contains a CKIMMessage object for the key CKMessageKey so basically

Now you have a CKIMMessage object to use. You should of course verify the object is not NULL before you try to access properties of it. You can have a quick look at CKIMMessage.h and you directly see that it contains a lot of information to use:

We will focus on the message parts a little bit more. It allows you to go through the entire message and filter out different types of parts (Text, Images, Videos).

As you can see, it is very easy to implement your own code when the user reads a message. If you want to find out more about the notification's userInfo, you can log it easily:

This should pretty much print all what is in the userInfo dictionary to the syslog.

Sending a Message in iOS 7
As of iOS 7, you can use something like the following code to send a message programatically. It will automatically decide whether to send as an SMS or iMessage:

Note that this will only work from the MobileSMS process, as [CKConversationList sharedConversationList] is null in other processes.

Useful Links

 * ChatKit.framework
 *