다음 작업을 수행하고 있지만 로깅 할 때 항상 이미지를 첨부 할 수 없다고 반환합니다. 여기 뭐가 잘못 됐니?MFMessageComposeViewController에 이미지를 첨부 할 수 없음
- (void)showInvitation {
if (![MFMessageComposeViewController canSendText]) {
UIAlertView *warningAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Your device doesn't support SMS!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[warningAlert show];
return;
}
NSString *message = [NSString stringWithFormat:@"Download this game!"];
MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init];
messageController.messageComposeDelegate = self;
[messageController setBody:message];
if ([MFMessageComposeViewController canSendAttachments]) {
NSLog(@"Attachments Can Be Sent.");
NSData *imgData = [NSData dataWithContentsOfFile:@"water"];
BOOL didAttachImage = [messageController addAttachmentData:imgData typeIdentifier:(NSString *)kUTTypePNG filename:@"image.png"];
if (didAttachImage) {
NSLog(@"Image Attached.");
} else {
NSLog(@"Image Could Not Be Attached.");
}
}
[self presentViewController:messageController animated:YES completion:nil];
}
어떤 계정입니까? 아마도 ISP가 MMS를 차단합니까? iMessage를 사용해보십시오. –
첨부 파일을 콘솔에 기록 할 때 첨부 파일을 보낼 수 있다고 말합니다. imessage로 어떻게 시도 할 수 있습니까? – KingPolygon
실제로 iMessage를 사용하고 있습니다. – KingPolygon