IOS私有API 发送sms

#import 
#import "CTMessageCenter.h"

int main(int argc, char *argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    NSString *message = [NSString stringWithUTF8String:argv[1]];
    NSString *number = [NSString stringWithUTF8String:argv[2]];

    BOOL success = [[CTMessageCenter sharedMessageCenter]  sendSMSWithText:message serviceCenter:nil toAddress:number];

    if(success == TRUE) {
        printf("Message appears to have been sent.\n");
    }
    else {
        printf("Message failed.\n");
    }

    [pool release];
}


#import 

@interface CTMessageCenter : NSObject
{
}

+ (id)sharedMessageCenter;
- (id)init;
- (id)sendSMS:(id)fp8;
- (id)sendMMSFromData:(id)fp8 messageId:(unsigned int)fp12;
- (id)sendMMS:(id)fp8;
- (id)send:(id)fp8;
- (id)incomingMessageWithId:(unsigned int)fp8 telephonyCenter:(struct __CTTelephonyCenter *)fp12 isDeferred:(BOOL)fp16;
- (int)incomingMessageCount;
- (id)allIncomingMessages;
- (void)acknowledgeIncomingMessageWithId:(unsigned int)fp8;
- (void)acknowledgeOutgoingMessageWithId:(unsigned int)fp8;
- (id)incomingMessageWithId:(unsigned int)fp8;
- (id)deferredMessageWithId:(unsigned int)fp8;
- (id)statusOfOutgoingMessages;
- (id)encodeMessage:(id)fp8;
- (id)decodeMessage:(id)fp8;
- (BOOL)isMmsEnabled;
- (BOOL)isMmsConfigured;
- (BOOL)sendSMSWithText:(id)fp8 serviceCenter:(id)fp12 toAddress:(id)fp16;

@end


你可能感兴趣的:(IOS)