Page MenuHomePhabricator

Support opening specifc pages via inbound url requests from other apps
Closed, ResolvedPublic

Description

In 5.0.5 we released T135048 which lets other apps open Wikipedia via the "wikipedia:" url scheme (see ticket/pull request for specifics). However for this to work meaningfully, the application delegate needs to implement application:openURL:options:

Event Timeline

Need a few clarifications. What should the url look like?

Simplest would just be

wikipedia:article_id

And maybe

wikipedia:/wiki/article_id

Then, should it be possible to specify a language as part of the url? If no language is specified the app should probably just use the user's primary language.

It might be easiest to just use the URL scheme from the web (since we also need to send the language):

https://en.wikipedia.org/wiki/Ricketts_Glen_State_Park

->

wikipedia://en.wikipedia.org/wiki/Ricketts_Glen_State_Park

Search:

https://en.wikipedia.org/w/index.php?search=dog

->

wikipedia://en.wikipedia.org/w/index.php?search=dog

We have 3 "pages" in the app that are not on the web: Explore, Saved, History

For those maybe something like:
wikipedia://explore
wikipedia://saved
wikipedia://hisory

Hi @jberkel just a heads up that we are hoping to be dev complete for the 5.1 release by Friday. If you can submit a PR by then we will get it reviewed (and tested if passes review) and in our next update, for release in late August. Otherwise I will roll it over to the next version, which should be out around the iOS 10 launch.

Thanks!

Testing criteria

Special app pages

  1. Open Safari browser
  2. type "wikipedia://saved" into the address bar and press Go
  3. an alert should pop up asking to open the link in the Wikipedia app, tap Open
  4. the app should open on the Saved tab

Articles

  1. Open Safari browser
  2. paste or type "wikipedia://en.wikipedia.org/wiki/Red" into the address bar and press Go
  3. an alert should pop up asking to open the link in the Wikipedia app, tap Open
  4. the app should open on the Red article

Main page

  1. Open Safari browser
  2. paste or type "wikipedia://en.wikipedia.org/wiki/Main_page" into the address bar and press Go
  3. an alert should pop up asking to open the link in the Wikipedia app, tap Open
  4. the app should open on the mobile main page, with the headline "Today's featured article"

Language handling

  1. Open Safari browser
  2. paste or type "wikipedia://fr.wikipedia.org/wiki/Pomme" into the address bar and press Go
  3. an alert should pop up asking to open the link in the Wikipedia app, tap Open
  4. the app should open on article "Pomme" in french.

Search

  1. Open Safari browser
  2. paste or type "wikipedia://en.wikipedia.org/wiki/index.php?search=dog" into the address bar and press Go
  3. an alert should pop up asking to open the link in the Wikipedia app, tap Open
  4. the app should open on search page with results for dog displayed

I did some initial testing and everything worked for me, though I did it via browser testing, rather than from another app.

The only thing that didn't work was article urls that included #section. The article opens, but does not scroll to the section. Not a blocker I think, but a special case that didn't work for me.

I'm testing on iPhone 6S (iOS 9.1) and Wikipedia 5.1.0 (911). All of the Testing criteria passed on my device so this is fixed.

Hi @jberkel this should be in the next TestFlight beta, hopefully tomorrow, with app store release early next week.

Thanks for your contribution!

great! can somebody please add me to the testflight group? have already sent my details to @Fjalapeno.