始终显示“好友名称”,通过我的iOS应用程序在iMessage中 [英] Always displaying "Buddy Name, " in iMessage via my iOS app
问题描述
DESIGN:在我的应用程序中,我正在使用iMessage post选项。它完美地解决了一个愚蠢的问题。这是我的代码:
DESIGN: In my app, am using iMessage post option. Its works perfectly with one silly problem. Here is my code:
if(!TARGET_IPHONE_SIMULATOR){
if ([MFMessageComposeViewController canSendText]){
MFMessageComposeViewController *MFMsgPicker = [[MFMessageComposeViewController alloc] init];
MFMsgPicker.messageComposeDelegate = self;
MFMsgPicker.recipients = [NSArray arrayWithObject:@""]; // your recipient number or self for testing
MFMsgPicker.body = [NSString stringWithFormat:@"Send from my app"];
if ([MFMessageComposeViewController canSendAttachments]) {
// data code for attachment here. worked perfectly. so removed it.
NSLog(@"Attachments Can Be Sent.");
[self presentViewController:MFMsgPicker animated:YES completion:nil];
}
else{
[CommonMethods alertFromCommonMethods:@"Your device doesen't support the iMessage Attachment feature!"];
[appDelegate stopProgressLoading];
}
}
else{
[CommonMethods alertFromCommonMethods:@"Your device doesen't support the iMessage send text feature!"];
[appDelegate stopProgressLoading];
}
}
else{
[CommonMethods alertFromCommonMethods:@"Your device doesen't support the iMessage"];
[appDelegate stopProgressLoading];
}
问题:
我的应用程序时-direct到iMessage,收件人字段始终带有文本Buddy Name。我可以编辑它,但为什么它发生!不仅在我的设备和我的客户也面对这个。我的客户想要避免这种情况。
工具:
* Xcode 5.1.1 >
*使用iOS 8,7在iPhone和iPad上进行测试。不遵循iOS 6.
PROBLEM:
When my app re-direct to the iMessage, the recipient field always with text "Buddy Name, ". I can edit it but why its happening!. Not only in my device and my client also facing this. And my client wants to avoid that.
Tool:
* Xcode 5.1.1
* Tested in both iPhone and iPad with iOS 8, 7. Am not following iOS 6.
推荐答案
看起来它是默认值bei Apple如果使用空字符串。 (这不是零)
It looks like it is a default value bei Apple if using an empty string. (It is something else than nil)
MFMsgPicker.recipients = nil;
工作正常。
一如既往:如果你不需要它 - 不要这样做。
但为什么你不给它一些有用的价值?
worked fine.
As always: if you dont need it - dont do it.
But why arent you giving some useful value to it?
这篇关于始终显示“好友名称”,通过我的iOS应用程序在iMessage中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!