-2

我正在开发类似于 Pimp 的 iPhone 应用程序我的文本可在此处获得:http: //itunes.apple.com/us/app/pimp-my-text-send-color-text/id489972714 ?mt=8

我正在尝试找到一种方法来像应用程序一样发送彩色和动画消息。我已经通过使用 UIWebview 进行了尝试,但似乎在应用程序中使用了粘贴板来发送 iMessage,但它不起作用。粘贴板从消息的编辑器屏幕复制消息并将其粘贴到默认的 iMessage 控制器。但我不确定它是如何在应用程序中完成的。

任何人都可以建议任何方式来发送带有效果的彩色动画文本吗?

4

1 回答 1

0

I have fixed this by following code:

 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
           pasteboard.persistent = YES;
           NSString *imagefile =app.strimagepath;

           ///  
           BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:imagefile];

           if (fileExists)
           {    
               NSData *data = UIImagePNGRepresentation([UIImage imageWithContentsOfFile:imagefile]);
               pasteboard.image = [UIImage imageWithData:data];
           }
           NSString *phoneToCall = @"sms: 123-456-7890";
           NSString *phoneToCallEncoded = [phoneToCall stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
           NSURL *url = [[NSURL alloc] initWithString:phoneToCallEncoded];

           [[UIApplication sharedApplication] openURL:url];

Here app.strimgPath is the path of image stored in document directory. when the MessageView is opened. Longpress and click on Paste and message will be pasted.

May be the question I asked did not clarified correctly as what I want. But the above was something that solved my purpose.

于 2012-05-25T11:57:05.910 回答