Answer the question
In order to leave comments, you need to log in
Sending hidden SMS in iOS?
Hello,
I am writing a tweak for jailbreak iOS in which I need the ability to send hidden SMS. I found this solution on StackOverflow:
dispatch_queue_t queue = dispatch_queue_create("com.apple.chatkit.clientcomposeserver.xpc_connection_queue", DISPATCH_QUEUE_SERIAL);
xpc_connection_t connection = xpc_connection_create_mach_service("com.apple.chatkit.clientcomposeserver.xpc", queue, 0);
xpc_connection_set_event_handler(connection, ^(xpc_object_t){});
xpc_connection_resume(connection);
dispatch_release(queue);
xpc_object_t dictionary = xpc_dictionary_create(0, 0, 0);
xpc_dictionary_set_int64(dictionary, "message-type", 0);
NSData* recipients = [NSPropertyListSerialization dataWithPropertyList:[NSArray arrayWithObject:@"12212"] format:NSPropertyListBinaryFormat_v1_0 options:0 error:NULL];
xpc_dictionary_set_data(dictionary, "recipients", recipients.bytes, recipients.length);
xpc_dictionary_set_string(dictionary, "markup", "SMS text");
xpc_connection_send_message(connection, dictionary);
xpc_release(dictionary);
To send message using this code your application entitlements should have com.apple.messages.composeclient key with boolean value set to true. Otherwise you get error in console saying application lacks entitlement.
Answer the question
In order to leave comments, you need to log in
add the com.apple.messages.composeclient key to the application plist and set its value to YES
As I understand it, this is generally not specified by the code. And you must have a production acc with official permission from apple for this implementation.
Personally, I would not want to get an application that itself sent something via SMS. So you have to write to apple technical support and get it right.
I made this conclusion from a comment to the same post on SO.
Unfortunately, no. Did you sign your app with the entitlement? If you did I will create and post a sample project.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question