Search code examples
iosobjective-cios-app-extensionimessageimessage-extension

iMessageExt app Error starting application


I created my iMessage extension, when I try to open it, the first screen appears but it is totally frozen, and it does not react in any way.

I've put logs in the viewDidLoad of that first view and nothing appears there, after a few seconds I can already see those logs.

To make the application freezing lose that status, user has to slide screen left or right and back again.

I've tried looking all over the web for someone who happens to be the same, but I could not find anything.

It does not come to mind more screenshots or portions of code add, if you think I should provide some additional information, just let me know

Any help would be appreciated.

Thank you.

UPDATE:

This is my Project Structure.

enter image description here

This is my viewDidLoad code.

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSLog(@"here viewDidLoad iMessage ext~~~!");
    [self applyCornerRadiusToBtn];
    [self registerPresentationAction];

    NSDictionary *user = [self getUserInfoFromHostApp];
    if (user) {
        NSLog(@"Here != null user info");
        //It is assumed that when you enter this point and run this log, the app should navigate to the next screen, but it does not.
        [self performSegueWithIdentifier:@"goToYoutubeListIm" sender:nil];
    } else {
        NSLog(@"Here userInfo null");
    }
}

- (NSDictionary *)getUserInfoFromHostApp
{
    NSUserDefaults *myDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.xxxxx"];
    NSDictionary *userNameSaved = [myDefaults objectForKey:@"userInfoExt"];;
    NSLog(@"userNameSaved in xxxx Ext ==> %@",userNameSaved);

    NSURL *groupURL = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:@"group.com.xxxx"];
    NSLog(@"groupURL ==> %@",groupURL);

    return userNameSaved;
}

Solution

  • For all concerned I have found the problem or problems to be accurate.

    1) I was creating my controllers type MSMessagesAppViewController. Apparently there should only be one controller of this type.

    2) I had logic in the viewDidAppear in my MSMessagesAppViewController. For some strange reason this also caused the problem, I had to get the logic out there and force the user to interact with a button to execute the logic that was in the didAppear