Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep Link support added for places #4986

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

raihan
Copy link

@raihan raihan commented Sep 23, 2024

Background Context:

I have added deep link support for places in the Wikipedia app. So, when the Wikipedia app is opened through the deep link, it will directly go to the ‘Places’ tab and show the location specified by the caller app.

In this PR:

  • Added deep link support for location coordinates (latitude & longitude) and name.
  • Used existing logic to search places with coordinates.
  • Used existing logic to search places with names.

Testing Steps:

Please use the following deep link patterns

  • With coordinates: wikipedia://places?WMFArticleURL=https://en.wikipedia.org/wiki?place=Amsterdam&latitude=52.3547498&longitude=4.8339215
  • With location name: wikipedia://places?WMFArticleURL=https://en.wikipedia.org/wiki?place=Berlin

Screenshot/demo:

Wikipedia-deep-link.mov

@raihan raihan marked this pull request as draft September 23, 2024 16:19
@tonisevener
Copy link
Collaborator

@raihan Thanks for the improvement! I have created an associated Phabricator task so that we can track it's status on our workboard - https://phabricator.wikimedia.org/T377343.

I notice this is still marked as Draft. Is there anything you need from us before marking this as Ready for Review?

@raihan raihan marked this pull request as ready for review October 16, 2024 15:31
@raihan
Copy link
Author

raihan commented Oct 16, 2024

@raihan Thanks for the improvement! I have created an associated Phabricator task so that we can track it's status on our workboard - https://phabricator.wikimedia.org/T377343.

I notice this is still marked as Draft. Is there anything you need from us before marking this as Ready for Review?

I opened the PR.

Copy link
Collaborator

@tonisevener tonisevener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raihan Thanks for the improvement! I have one issue with getting longitude and latitude to work. If you have another deep link I could test with let me know.


if (latitude && longitude) {
// If the place coordinate is provided in the URL, show it in the map
[[self placesViewController] searchPlaceWithCoordinateWithLatitude:latitude longitude:longitude];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to hit this condition - I think the latitude and longitude values are getting dropped somewhere.

@@ -1215,9 +1215,21 @@ - (BOOL)processUserActivity:(NSUserActivity *)activity animated:(BOOL)animated c
[self.currentTabNavigationController popToRootViewControllerAnimated:animated];
NSURL *articleURL = activity.wmf_linkURL;
if (articleURL) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Optional)

This may be tricky to fix, but I would prefer if we removed the whole WMFArticleURL= part of these places deep links:

wikipedia://places?WMFArticleURL=https://en.wikipedia.org/wiki?latitude=52.3547498&longitude=4.8339215
wikipedia://places?WMFArticleURL=https://en.wikipedia.org/wiki?place=Berlin

It is unnecessary information, and indicates we are searching against the subdomain wiki (en.wikipedia.org), when in reality the app searches against the primary app language wiki in Settings.

If you could find a way to get these two links to work instead:

wikipedia://places?latitude=52.3547498&longitude=4.8339215
wikipedia://places?place=Berlin

I think that would feel better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants