MFMessageComposeViewController much slower on iOS 7
Asked Answered
T

3

10

I've an app for sending email and text messages.

The problem that i'm having is that the loading of the MFMessageComposeViewController much slower on iOS 7 than it was on prior iOS and it becomes worst as the number of contacts increases.

Screen goes black for seconds before Messages app opens with the contents loaded.

Any thoughts?

With the same large number of emails, the MFMailComposeViewController is as quicker as before.

Help!! Thanks.

Transcendent answered 26/9, 2013 at 11:37 Comment(4)
Have you duplicated the issue in a new empty project?Adrenocorticotropic
No. I'm using a copy of the live project.Transcendent
I mean are you sure this isn't caused by something in your project. Are you using any custom fonts in nav bars? Prove the problem in a simple project. Raise a bug with Apple if it still happens in the simple project.Adrenocorticotropic
I've already dropped the issue on Apple. The prove that I have is that is the exact same code used on iOS 6 and it was quick then.Transcendent
W
1

This issue has been fixed with iOS7.0.3

Windage answered 24/10, 2013 at 13:1 Comment(0)
A
4

I have the same problem. I made the composer strong reference with

@property (nonatomic, strong, retain) MFMessageComposeViewController *messageComposer;

Then owner class calls this method:

-(void)sendSMSFromController:(UIViewController*)controller
{
    self.messageComposer = [MFMessageComposeViewController new];

    if([MFMessageComposeViewController canSendText]) {
        [_messageComposer setBody:_body];
        [_messageComposer setRecipients:[NSArray arrayWithObjects:_recipient, nil]];
        [_messageComposer setMessageComposeDelegate:self];
        [controller presentViewController:_messageComposer animated:NO completion:NULL];
    }
}

Composer appears quickly but disappears slowly. Finalizes with:

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
{
    switch (result) {
        case MessageComposeResultCancelled:
            NSLog(@"Message sending cancelled.");
            break;

        case MessageComposeResultFailed:
            NSLog(@"Message sending failed.");
            break;

        case MessageComposeResultSent:
            NSLog(@"Message sent.");
        default:
            break;
    }


    [controller dismissViewControllerAnimated:YES completion:^(){
        self.messageComposer = nil;
    }];
}

After restarting my device it clearly works. Before restart (after messing with MessageService by sending invalid recipients) it failed.

Ashelyashen answered 21/11, 2013 at 17:31 Comment(2)
Thanks, that worked for me… i still found so strange i had to restart my iphone…Inapprehensible
Seems like the MessageService contains some singleton, that has not a thread-safe initialisation.Ashelyashen
D
1

I am encountering this issue as well, for iMessage recipients.

Seems to be tied to iMessage syncing history down from iCloud. I had 4 recipients and it took about ~30 seconds for the first Apple iMessage dialog to pop up.

After waiting on this once, I canceled out of the sends, the next repeated attempt resolved quickly -- this result, plus the fact that iOS7 displays message history in the composer view (pre iOS7 does not), has led me to conclude that Apple is waiting on some kind of iCloud sync before popping up the view.

This reproduced on both an iPhone 4 and a new iPhone 5s with different iCloud accounts, so it does not seem to be hardware limited or unique to my iCloud account or recipients.


I have no confirmed solution for this issue, but I have some workarounds to suggest for further investigation:

  • Some of our users have reported that rebooting the device resolves this issue.
  • This may be a "1 time fee" per unique iMessage recipient after upgrading to iOS7.
Descend answered 27/9, 2013 at 17:55 Comment(2)
I have the same issue with iMessage composing as well. However I have an entirely different issue is that sometimes the message won't even send it all. The issue is resolved after rebooting the device though. I've been wracking my brain over the problem, and it seems intermittent.Ancestry
Exact same here, and from my testing it appears to be tied to recipients that have a history on the device, ie that you've messaged before. If you pick a recipient that you don't have an existing iMessage/SMS thread with, the controller is responsive immediately after being presented, and the message is sent successfully after pressing send. As above have mentioned, restarting the device (in my case an iPhone 5) solves the problem (temporarily).Gentlemanfarmer
W
1

This issue has been fixed with iOS7.0.3

Windage answered 24/10, 2013 at 13:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.