4

MFMessageComposeViewController を使用して大量の受信者リスト (40 を超えるなど) を送信しようとすると問題が発生します。iOS7 では、SMS 作成ビューを表示する前に 20 秒以上空白の画面が表示されます。これは、iOS5 および iOS6 では発生しません。

以下は、私が使用している既存のコードです。

NSArray * recipients;

for (NSIndexPath * index in selectedRows) 
{ 
   NSDictionary *dictionary = [data objectAtIndex:index.row];
   NSString *phoneNum =  [dictionary objectForKey:@"contactNum"];
   recipients = [NSArray arrayWithObjects:phoneNum, nil]];
}

MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];

if([MFMessageComposeViewController canSendText])
{
    controller.body = bodyOfMessage;
    controller.recipients = recipients;
    controller.messageComposeDelegate = self ;
    controller.wantsFullScreenLayout = NO;
    [(id)_delegate presentModalViewController:controller animated:YES];
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
}

以下は、多くの人に送信しようとしたときに受け取った出力メッセージです。

timed out waiting for fence barrier from com.apple.mobilesms.compose
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
4

5 に答える 5

4

コンソールにメッセージが表示されるという同様の問題がありました」

com.apple.mobilesms.compose からのフェンス バリアの待機中にタイムアウトしました

問題は、アプリで番号を文字列として追加しようとしたことですが、ローカリゼーション リクエストのため、次の形式にしました。NSArray *recipents = @[NSLocalizedString(@"numberForRegistrationViaSms", @"")];

[messageController setRecipients:@[recipents]];

なぜかうまくいきませんでしたが、簡単に言うと[messageController setRecipients:@[@"123456789"]];、SMS composer は問題なく表示されます。

于 2014-03-16T18:38:12.760 に答える
2

私は同じ問題を抱えていた

controller.recipients= // 常に文字列の配列でなければなりません。

controller.recipients に送信する電話番号が NSString であることを確認してください。

于 2014-02-18T11:49:31.607 に答える
1

私は同じ問題を抱えていました。

  • com.apple.mobilesms.compose からのフェンス バリアの待機中にタイムアウトしました

  • メッセージがキャンセルされました

これの代わりに:

    NSString *phoneNumber = @"888888888";
    [picker setRecipients:@[phoneNumber]];

これを試して:

    NSString *phoneNumber = person.phoneNumber;
    [picker setRecipients:@[[NSString stringWithFormat:@"%@", phoneNumber]]];

これは私にとってはうまくいきました。

于 2015-03-26T08:24:42.567 に答える