Rob Stearn in Coding 7 minutes

Apps as first-class citizens of the web

Staying aware of new opportunities in technology is vital, and at (hereafter NOTHS) we are always feeding back on the things we see that could add to our products. Our Gift Finder app for iOS is a project I’m proud to be a part of and I’m excited to help push us to embrace ideas to make it better than ever. The mobile team is small, in comparison to the resource we have for our website, but we know that many of our users have great loyalty to the app and the quality of the code and the design is important to us.

I was fortunate enough to attend Apple’s Worldwide Developer Conference, in June, in San Francisco. As always WWDC provides more than enough fuel for discussion and experimentation among the tech industry and this year was no exception. With announcements of new OS versions, native watch apps and the open-sourcing of Swift it’s easy to miss the more strategic and far-reaching APIs and tools.

Hi, I’m an engineer in the mobile team, working on our iOS apps, I want to talk about just one of these new APIs, the innocuosly-titled Search API.

The new arena

Some background: One interesting announcement at Google I/O this year was the optional extension of ‘Google Now’ to in-app data. This means that app data is searched and surfaced in proactive information announcements by the Google Now API. Additionally the content can be indexed by the Google Search API and surfaced in web search results. Obviously this is subject to apps opting-in as the data will be processed by Google and the analytical results used in their standard business of presenting relevant advertising to users.

Privacy is the new arena of competition between the large tech companies. Google has very plainly built their business and revenue model around using user data for analysis in order to allow advertisers to target people more accurately. Facebook, equally, analyses a user’s profile and content to determine what to present. By comparison, Apple has been very vocal in saying that they are not interested in our data, or in using or selling it, however anonymized it is.

One criticism that is levelled at Apple is that they should offer parity in web-services before throwing stones in the glasshouse of data privacy. This is a fair pushback and one that Apple has been addressing by improving iCloud, releasing CloudKit for iOS (and now web), releasing the excellent iCloud Photo Library and the recent launch of Apple Music.

##The old arena This isn’t the only contest of course. One that’s had some interesting twists recently is the long-running ‘native apps vs the web’ trope. It’s largely been proven to be a senseless argument, so I won’t re-tread old ground. The one thing worth mentioning are some voices being raised to perhaps let the web do what it does best, distribute content, rather than try to emulate the functions of apps from inside a browser - and always being behind the curve. An example of the concern about apps is this talk by Jeremy Keith from Clearleft. His concern is that the data he posts online on his site should always be accessible for posterity, and that wrapping it inside an app would put it inside a walled garden.

What is Search API

Search API is Apple’s answer to both the new and old challenges. It’s about providing comparative or superior web services, adding content to local search and to Siri on iOS, and also to make apps first-class citizens of the web, no longer just consumers of information but also providers of it.

Search API is, much like the original iPhone, actually three things. It’s comprised of:

  • CoreSpotlight
  • NSUserActivity
  • Universal Links

You can adopt one or more of these depending on the goals you want to achieve. So what do they do? First let’s look at the function of each, then let’s tie them together into a compelling story.

###Core Spotlight Your app content, indexed.

Add, delete or edit entries and have them surface the content of your app in Spotlight and Siri content searches, which aids discoverability of content. CoreSpotlight entries have a public flag where the search result can be anonymously marked as popular once a set threshold has been reached. These results are aggregated by iCloud and used to provide search results on the web.

###NSUserActivity ‘Browser history’ for your app.

Actually it does a lot more, but this is the purpose it has been expanded to encompass in iOS9. NSUserActivity is the basis of the Handoff/Continuity feature from iOS 8/OS X 10.10, where a task can be bundled up and passed to the next device you use. Examples include starting an email on your Mac, and walking away and picking up the progress on your iPhone. This ‘packaging’ of an activity point can also be used to create, store and reference activity within the app and surface it in the users search results.

###Universal Links App deep-linking with standard web URLs.

Currently deeplinking into an iOS app means defining a custom url scheme like mylovelyapp://, which have no central registration and therefore no way to enforce uniqueness. If someone else’s app registers the same custom URL scheme as yours then the results are undefined… Universal links allow you to use the same links your website uses to point to a page or item with the same piece of content in the app. If you have an app that leads or supports a website, then this is for you. Best of all, this is achievable with very minimal work on your website, basically a single JSON file.

##Bringing it all together So how do these three tie in together? Let’s use and the Gift Finder app as the basis for some examples…

You’re on you computer, shopping on our website. You find a product you like and share it with your friends via email. One friend opens the email on their iPhone and taps the link, the link opens in the Gift Finder app directly to the product. Another friend opens the link on their phone and taps it, and it goes to the mobile optimized site. The same link works the same way across all platforms, but directs to the enhanced experience of the app when possible.

It’s coming up to Christmas, and customised dog collars are hot! has the best one money can buy, from one of our partners. People are searching for it, and sharing across multiple platforms and devices. The results that are found by searches on the iphone (which take users to the Gift Finder app entry) also populate the web search results and enhance the ranking of the product.

Lastly, a passionate fan of is using the app on their mobile device. This person has a physical disability which means that accurately typing on a keyboard is difficult. Thankfully modern mobile devices offer ways to call out to their phone and ask questions. Siri, Cortana or Google Now for instance…. “Hey Siri…” (ding ding, Siri wakes up…) “find me a grey wool blanket” (ding ding) “I’ve found 6 results you might like”, “Open the first one”… on an iPhone the Gift Finder app opens with a beautiful presentation of the product, on other phones the mobile site opens with the same options, on the desktop the full site opens.

Hopefully this has shown the benefits to discoverability, and potentially increased conversion, that these new APIs can bring, as well as the benefits to both web and native platforms.

It’s definitely time to let apps play on the same level as web, and also benefit from an equal system of content interlinking.

##More information To learn more about these interesting new tools, I recommend first watching the two most relevant session videos from WWDC (login required)…

This post is based on a post I originally wrote on my own blog. There is a part two coming soon with some more in-depth technical details, which is currently in progress :)