Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

abcdefg12345

macrumors 6502
Original poster
Jul 10, 2013
281
86
hi, i'm trying to launch an app through its today widget with no success

Code:
- (IBAction)LaunchContainingApp:(id)sender {
    NSURL *customURL = [NSURL URLWithString:@"appname://"];
    [self.extensionContext openURL:customURL completionHandler:nil];
}


Screen Shot 2016-02-06 at 3.27.15 AM.png


what am i doing wrong i click the button and nothing happens
 
hi, i'm trying to launch an app through its today widget with no success

Code:
- (IBAction)LaunchContainingApp:(id)sender {
    NSURL *customURL = [NSURL URLWithString:@"appname://"];
    [self.extensionContext openURL:customURL completionHandler:nil];
}


View attachment 614421

what am i doing wrong i click the button and nothing happens

got it working
Code:
- (IBAction)LaunchContainingApp:(id)sender {
    NSURL *customURL = [NSURL URLWithString:@"appname://launch"];
    if (![[NSWorkspace sharedWorkspace] openURL: customURL]) {
        [[self extensionContext] openURL:customURL completionHandler:^(BOOL success) {
        }];
    }
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.