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?
Asked
Active
Viewed 401 times
1
1 Answers
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