0

I saw other questions on stacoverflow like this or this but none work with iOS 7. I want to send sms without MFMessageComposeViewController or other services like twilio. Can someone help me?

Community
  • 1
  • 1
user3078845
  • 3
  • 1
  • 5
  • This http://stackoverflow.com/questions/15872553/send-programmatically-sms-on-jailbreak-device?lq=1 works on iOS 7, I use it myself, Shabi Tech in comments confirmed it's working. You are doing something wrong if it's not working for you. – creker Mar 30 '14 at 19:07
  • I have this error: : mms: Could not send message, received error: 35" AND ": mms: error sending message: 35" ... Same of Shabi Tech... – user3078845 Mar 30 '14 at 20:16
  • All I'm saying is my solution works. Problem is somewhere else. In Shabi Tech's case it was wrong phone number. – creker Mar 30 '14 at 20:43
  • I use nsstring for toAddress and international code before number (I tried also without it but same result) and nil for serviceCenter. Entitlements are ok... What can I do? – user3078845 Mar 30 '14 at 21:29
  • @creker can u link my question in a conversation with Shabi Tech please? Because i can't solve the problem :( . Thanks – user3078845 Mar 31 '14 at 17:43
  • Check out comments to my answer but there was not much of a conversation. Wrong phone number is pretty much it. Unfortunately I can't do much here. It's private API so all errors are unknown. It's definitely works. You could post your code, maybe there is an error. – creker Mar 31 '14 at 20:09
  • Thanks for your help creker this is my code: #import "CTMessageCenter.h" BOOL success = [[CTMessageCenter sharedMessageCenter] sendSMSWithText:@"test" serviceCenter:nil toAddress:@"+1358######"]; I copied CTMessageCenter.h from here: https://github.com/EthanArbuckle/IOS-7-Headers/blob/master/Frameworks/CoreTelephony.framework/CTMessageCenter.h – user3078845 Mar 31 '14 at 21:26
  • I tried all but no good results. @creker can you attach me a worked project please? Thank you very much – user3078845 Apr 01 '14 at 20:25
  • Here you go http://www.sendspace.com/file/i6s6j7 Tested it on iPhone 5 with iOS 7.0.4. There is one thing you need to take care of - "Run Script" build phase. This is where application is signed. I used `codesign` which will probably not work for you. – creker Apr 06 '14 at 14:00
  • Thanks creker I tested your code in an app and works... Not works in logos tweak but I don't understand why... If you post one comment as an answer i check it as best! Thank you very much for your precious help – user3078845 Apr 07 '14 at 06:08

1 Answers1

1

Here is a sample project sendspace.com/file/i6s6j7 Tested it on iPhone 5 with iOS 7.0.4. There is one thing you need to take care of - "Run Script" build phase. This is where application is signed. I used codesign which will probably not work for you.

In case of a logos tweak you can't sign your tweak with any entitlements you want. Your code will use and is limited to entitlements of application your are hooking. If it's SpringBoard then it's SpringBoard's entitlements that lack com.apple.CommCenter.Messages-send. So for a SpringBoard tweak my solution with CTMessageCenter will not work. But XPC solution in my answer here will work. Unfortunately, SMS sent using XPC will show up in SMS database.

There are two possible solutions:

  1. Daemon. You can sign it with any entitlements you want and do pretty much anything you want.
  2. Write a tweak to another daemon just for SMS sending. Possible candidate - com.apple.imagent located in /System/Library/PrivateFrameworks/IMCore.framework/imagent.app/imagent. It signed with all the entitlements we need for SMS sending which is obvious because this daemon deals with SMS on lower level. It observes incoming SMS notifications, XPC calls like in my answer and other Instant Messaging related stuff.
Community
  • 1
  • 1
creker
  • 9,400
  • 1
  • 30
  • 47