modified url support to launch app on call log view from widget

This commit is contained in:
David Idmansour 2018-06-11 15:06:22 +02:00
parent 28c752ce8d
commit c72c1f03b6
2 changed files with 23 additions and 14 deletions

View file

@ -336,16 +336,21 @@
[errView addAction:yesAction];
[PhoneMainView.instance presentViewController:errView animated:YES completion:nil];
} else {
if ([[url scheme] isEqualToString:@"sip"]) {
// remove "sip://" from the URI, and do it correctly by taking resourceSpecifier and removing leading and
// trailing "/"
NSString *sipUri = [[url resourceSpecifier]
stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
[VIEW(DialerView) setAddress:sipUri];
}
}
return YES;
} else {
if ([[url scheme] isEqualToString:@"sip"]) {
// remove "sip://" from the URI, and do it correctly by taking resourceSpecifier and removing leading and
// trailing "/"
if ([[url host] isEqualToString:@"call_log"] &&
[[url path] isEqualToString:@"/show"]) {
[VIEW(HistoryDetailsView) setCallLogId:[url query]];
[PhoneMainView.instance popToView:HistoryDetailsView.compositeViewDescription];
} else {
NSString *sipUri = [[url resourceSpecifier] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
[VIEW(DialerView) setAddress:sipUri];
}
}
}
return YES;
}
- (void)fixRing {

View file

@ -39,19 +39,23 @@
completionHandler:nil];
}
- (void)launchOnHistoryDetailsWithId:(NSString *)logId {
[self launchAppWithURL:[NSURL URLWithString:[@"sip://call_log/show?" stringByAppendingString:logId]]];
}
- (IBAction)firstButtonTapped {
[self launchAppWithURL:[NSURL URLWithString:@"sip://"]];
[self launchOnHistoryDetailsWithId:@""];
}
- (IBAction)secondButtonTapped {
[self launchAppWithURL:[NSURL URLWithString:@"sip://"]];
[self launchOnHistoryDetailsWithId:@""];
}
- (IBAction)thirdButtonTapped {
[self launchAppWithURL:[NSURL URLWithString:@"sip://"]];
[self launchOnHistoryDetailsWithId:@""];
}
- (IBAction)fourthButtonTapped {
[self launchAppWithURL:[NSURL URLWithString:@"sip://"]];
[self launchOnHistoryDetailsWithId:@""];
}
@end