SMS メッセージングをアプリに実装する作業を行っています。残念ながら、テストするたびに、メッセージを送信して相手側で受信した場合でも、常にデフォルトの結果が得られます。私は何を間違っていますか、他の例を比較しましたが、私のものは同じように見えます。これはiMessageで動作しますか??? 今では、テキスト メッセージングに入って失敗したと表示されても、常に送信済みとして取得しています。
// feedback message field with the result of the operation.
- (void)messageComposeViewController:(MFMessageComposeViewController *)controller
didFinishWithResult:(MessageComposeResult)result {
switch (result)
{
case MFMailComposeResultCancelled:
[self displayStickieUniversalViewControllerTitleString:@"Cancelled" bodyString:@"You cancelled sending the SMS.The event will be saved in the calendar." buttonString:@"Ok, Save Event" bodyTextSize:12.0f buttonTextLines:3];
break;
case MFMailComposeResultSent:
[self displayStickieUniversalViewControllerTitleString:@"SMS sent" bodyString:@"Your SMS was sent. The event will be saved in the calendar." buttonString:@"Ok, Save Event" bodyTextSize:12.0f buttonTextLines:3];
break;
case MFMailComposeResultFailed:
[self displayStickieUniversalViewControllerTitleString:@"Failed" bodyString:@"Failed to send SMS. The event will be saved in the calendar." buttonString:@"Ok, Save Event" bodyTextSize:12.0f buttonTextLines:3];
break;
default:
[self displayStickieUniversalViewControllerTitleString:@"Failed" bodyString:@"Failed to send SMS. The event will be saved in the calendar." buttonString:@"Ok, Save Event" bodyTextSize:12.0f buttonTextLines:3];
break;
}
[self dismissModalViewControllerAnimated:YES];
}
/////
if (actionClicked == @"smsEvent") {
if ([attendeesArray count]!=0) {
NSLog(@"Yes clicked, will send sms confirmation");
Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));
if (messageClass != nil) {
if ([messageClass canSendText]) {
[self displaySMSComposerSheet];
}
else {
[self displayStickieUniversalViewControllerTitleString:@"Device not configured to send SMS." bodyString:@"The event will be saved in the calendar." buttonString:@"Save Event" bodyTextSize:14.0f buttonTextLines:2];
}
}
else {
[self displayStickieUniversalViewControllerTitleString:@"Device not configured to send SMS." bodyString:@"The event will be saved in the calendar." buttonString:@"Save Event" bodyTextSize:14.0f buttonTextLines:2];
}
}
}