iMessageExt app Error starting application
Asked Answered
B

1

6

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;
}
Brisling answered 9/2, 2017 at 22:28 Comment(5)
Please provide the additional information that you mentioned in the question.Pridemore
Please provide some code how you are creating extension so we can get idea whats going wrong.Thoracoplasty
when the screen is frozen pause the app and see what the stacktrace says. This will lead you to where the freezing is.Bifoliolate
Can you try implementing the navigation code logic ( [self performSegueWithIdentifier:@"goToYoutubeListIm" sender:nil]; ) in view did appear, than in view did load ?Grunter
@SahanaKini, thanks for answer but not works. The problem persistBrisling
B
0

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

Brisling answered 21/2, 2017 at 12:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.