From 327cb880c5c9786c4c19abf8d13d0ae5785e47a1 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 9 Apr 2023 18:04:36 +0200 Subject: [PATCH] Added support for handling a location coming in from the a places user activity inside the "processUserActivity: animated: completion:" function in the WMFAppViewController view controller. --- Apps/Wikipedia/Wikipedia/Code/WMFAppViewController.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Apps/Wikipedia/Wikipedia/Code/WMFAppViewController.m b/Apps/Wikipedia/Wikipedia/Code/WMFAppViewController.m index 4fa02b8..3a5fb6c 100644 --- a/Apps/Wikipedia/Wikipedia/Code/WMFAppViewController.m +++ b/Apps/Wikipedia/Wikipedia/Code/WMFAppViewController.m @@ -1187,10 +1187,16 @@ NSString *const WMFLanguageVariantAlertsLibraryVersion = @"WMFLanguageVariantAle [self setSelectedIndex:WMFAppTabTypePlaces]; [self.navigationController popToRootViewControllerAnimated:animated]; 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. [[self placesViewController] updateViewModeToMap]; - [[self placesViewController] showArticleURL:articleURL]; + if (locationFromURL) { + [[self placesViewController] centerMapOnLocation:locationFromURL]; + } + else if (articleURL) { + [[self placesViewController] showArticleURL:articleURL]; + } } } break; case WMFUserActivityTypeContent: {