Difference between revisions of "CKMadridService"

From iPhone Development Wiki
Jump to: navigation, search
m (CKMadridService)
m (Reverted edits by Ahyattdev (talk) to last revision by Uroboro)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==CKMadridService==
+
'''CKMadridService''' is Apple's codename for the service used to send iMessages. It is available only in iOS 5 (see [[ChatKit.framework]]).
 
 
'''CKMadridService''' is Apple's secret codename for the service used to send iMessages. Available only in iOS 5.
 
  
 
==Creating and sending an iMessage with CKMadridService==
 
==Creating and sending an iMessage with CKMadridService==
Line 32: Line 30:
 
*Note that you are responsible for releasing the message and the composition, but not the conversation.  
 
*Note that you are responsible for releasing the message and the composition, but not the conversation.  
  
==References==
+
== External links ==
 +
 
 
Header: https://github.com/masbog/PrivateFrameworkHeader-iOS-iPhone-5.-/blob/master/ChatKit.framework/CKMadridService.h
 
Header: https://github.com/masbog/PrivateFrameworkHeader-iOS-iPhone-5.-/blob/master/ChatKit.framework/CKMadridService.h
 +
 
{{occlass|library=ChatKit.framework|navbox=2}}
 
{{occlass|library=ChatKit.framework|navbox=2}}

Latest revision as of 02:47, 23 September 2015

CKMadridService is Apple's codename for the service used to send iMessages. It is available only in iOS 5 (see ChatKit.framework).

Creating and sending an iMessage with CKMadridService

//Compose a message
CKMessageStandaloneComposition *composition = [CKMessageStandaloneComposition newCompositionForText:@"Test Message"];

//Get a reference to the shared conversation list
CKConversationList *conversationList = [CKConversationList sharedConversationList];

//Get a reference to the shared Madrid Service
CKMadridService *madridService = [CKMadridService sharedMadridService];

NSString *messageRecipient = @"+1234567890"; // This is the phone number or email of the message recipient

//Make a Conversation
CKSubConversation *conversation = [conversationList conversationForGroupID:messageRecipient create:YES service:madridService];

//Create a message
CKMadridMessage *message = [madridService newMessageWithComposition:composition forConversation:conversation];

[madridService sendMessage:message];

[message release];
[composition release];
  • Note that you are responsible for releasing the message and the composition, but not the conversation.

External links

Header: https://github.com/masbog/PrivateFrameworkHeader-iOS-iPhone-5.-/blob/master/ChatKit.framework/CKMadridService.h