使用私有框架以编程方式发送iMessage

有谁知道是否有可能使用私人框架直接发送iMessage?

我尝试从CoreTelephony使用CTMessageCenter ,但它会发送短信,即使我的手机可以发送iMessages。

我没有testing过,但看看这里发布的代码 。 如果你看看httpResponseForMethod:URI:你看到他/她发送消息的地方(似乎是硬编码,以支持iOS 5或iOS 4 ):

 CKSMSService *smsService = [CKSMSService sharedSMSService]; //id ct = CTTelephonyCenterGetDefault(); CKConversationList *conversationList = nil; NSString *value =[[UIDevice currentDevice] systemVersion]; if([value hasPrefix:@"5"]) { //CKMadridService *madridService = [CKMadridService sharedMadridService]; //NSString *foo = [madridService _temporaryFileURLforGUID:@"A5F70DCD-F145-4D02-B308-B7EA6C248BB2"]; NSLog(@"Sending SMS"); conversationList = [CKConversationList sharedConversationList]; CKSMSEntity *ckEntity = [smsService copyEntityForAddressString:Phone]; CKConversation *conversation = [conversationList conversationForRecipients:[NSArray arrayWithObject:ckEntity] create:TRUE service:smsService]; NSString *groupID = [conversation groupID]; CKSMSMessage *ckMsg = [smsService _newSMSMessageWithText:msg forConversation:conversation]; [smsService sendMessage:ckMsg]; [ckMsg release]; } else { //4.0 id ct = CTTelephonyCenterGetDefault(); void* address = CKSMSAddressCreateWithString(pid); int group = [grp intValue]; if (group <= 0) { group = CKSMSRecordCreateGroupWithMembers([NSArray arrayWithObject:address]); } void *msg_to_send = _CKSMSRecordCreateWithGroupAndAssociation(NULL, address, msg, group, 0); CKSMSRecordSend(ct, msg_to_send); } 

该代码使用普通的SMS,但是您可以看到以下注释掉的代码:

 //CKMadridService *madridService = [CKMadridService sharedMadridService]; 

“马德里”服务可能是什么可以发送iMessages。 在这里看到私人标题 。

SMS和iMessage私有API都在ChatKit.framework中

通过非越狱iPhone,绝对不能访问iMessage CoreTelephony API