1

For example, my App is called Complicate It. Currently when its complication is tapped, Complicate It opens. I'd like to be able to open a different app, say Messages, when the complication is tapped. Is this at all possible?

Stefan
  • 5,203
  • 8
  • 27
  • 51
swiftyboi
  • 2,965
  • 4
  • 25
  • 52

1 Answers1

1

What is the meaning of difference App exactly? If you mean arbitrary apps that includes 3rd parties, It's not possible.

You can figure out whether the app is launched by tapping complication using user activity.

Override your ExtensionDelegate or main InterfaceController like this:

-(void)handleUserActivity:(NSDictionary *)userInfo
{
    NSDate* timelineDate = userInfo[CLKLaunchedTimelineEntryDateKey];
    if(timelineDate){
        NSLog(@"Launched by complication!");
    }
    else{
        NSLog(@"Launched by other reason!");
    }
}

You can open System Apps using WKExtension.openSystemURL(NSURL*), see available URL schemes.

[[WKExtension sharedExtension] 
 openSystemURL: [NSURL URLWithString:@"mailto:someone@somecompany.com"]];
jeeeyul
  • 3,727
  • 1
  • 24
  • 37