[Feature] Enhance the places deep linking support in the Wikipedia app to support coordinates #2

Merged
javier merged 5 commits from feature/places-deep-linking into main 2023-04-09 16:27:54 +00:00
Showing only changes of commit 327cb880c5 - Show all commits

View File

@ -1187,11 +1187,17 @@ NSString *const WMFLanguageVariantAlertsLibraryVersion = @"WMFLanguageVariantAle
[self setSelectedIndex:WMFAppTabTypePlaces]; [self setSelectedIndex:WMFAppTabTypePlaces];
[self.navigationController popToRootViewControllerAnimated:animated]; [self.navigationController popToRootViewControllerAnimated:animated];
NSURL *articleURL = activity.wmf_linkURL; NSURL *articleURL = activity.wmf_linkURL;
if (articleURL) { CLLocation *locationFromURL = activity.wmf_locationFromURL;
if (articleURL || locationFromURL) {
// For "View on a map" action to succeed, view mode has to be set to map. // For "View on a map" action to succeed, view mode has to be set to map.
[[self placesViewController] updateViewModeToMap]; [[self placesViewController] updateViewModeToMap];
if (locationFromURL) {
[[self placesViewController] centerMapOnLocation:locationFromURL];
}
else if (articleURL) {
[[self placesViewController] showArticleURL:articleURL]; [[self placesViewController] showArticleURL:articleURL];
} }
}
} break; } break;
case WMFUserActivityTypeContent: { case WMFUserActivityTypeContent: {
[self dismissPresentedViewControllers]; [self dismissPresentedViewControllers];