QR Capabilities in iOS 11

Since iOS 11, the native camera app can decode QR codes. QR codes are the default serialization tag for the ADIs of Thngs and products in our platform.

We believe native QR code support allows for a fundamental change in the way people interact with real-world objects. Until now, a user could interact with a QR code Thng only through a web app that uses scanthng.js or by downloading a native app that supports QR codes. With iOS 11, over a billion iPhone and iPad users can directly interact with Thngs by scanning a QR code directly from the camera app with no third-party app.

A powerful feature of the EVRYTHNG platform is the Redirector. The Redirector allows you to write simple context-aware rules that are fired when the QR code of a product or Thng is scanned. The Redirector supports redirection to web pages and native apps.

Use Case: Play a Song Near Me

Here's example of how EVRYTHNG can help you drive a native user experience on an iOS 11 device. In this use case, you use a Thng, its QR code, and the Redirector to build a campaign that opens a song on iTunes based on where the QR code on a Thng or product was scanned.

  1. Log in to your EVRYTHNG account in the Dashboard. If you're not familiar with our platform, see the Getting Started to learn the basics.

  2. Create a project. Be sure to set "Current Project" to your QR code project, otherwise resources (such as applications or Thngs) will be unscoped and accessible to every project in your account.

  1. In the newly created project, create an application, "Songs of London."

  2. Create a Thng using the 'Thngs' section. The newly created Thng doesn't have a QR code yet. You add that after the redirector is set up.

  1. Go to the account Redirector using the left navigation panel.
  1. Add a rule to the account Redirector to defer the redirection result to the previously created application, "Songs of London."
  1. In the "Songs of London" application, scroll down and add an application Redirector rule by selecting Create Rule.

  2. To create a rule that plays "Streets of London" when someone scans a QR code near the EVRYTHNG office, set the name to "Streets of London" and the Redirect URL to https://itun.es/gb/et8st?i=323732789. Because iOS apps can be bound to URLs, this opens the native iTunes app with the selected song. With this mechanism, you can drive native experiences through the web.

  1. Declare this rule to trigger when the QR code is scanned in or near London by adding two conditions:
  • Location latitude between 50.0 and 51.0.
  • Location longitude between 0.0 and 1.0.
  1. Click Create rule.
  1. Add more songs as desired, change the coordinates to your location, or add other context-based rules. The example above shows an additional song for when the QR code is scanned in New York.

  2. Go back the Thng you created and click Setup redirection.

  1. For the application, select "Songs of London," add a default URL, and click Create Redirect to create the rule.

A QR code is created to enable devices to follow the redirection.


Now that your Redirector is set up and working properly, open the camera app on your iPhone or iPad and target the QR code on your screen. You don't need to take a picture. You see a notification when the QR code is decoded. If you don't have iOS 11 installed yet, try the QR code scanner that comes with another app, such as Twitter or Chrome. When you scan the code, the Redirector returns the URL of the song in iTunes based on your location.

Differences Between Reactor and Redirector

The EVRYTHNG Platform has two rules-based systems: the Reactor and the Redirector.

  • The Redirector is synchronous and returns a valid URI based on simple rules. The Redirector can redirect to the URL of a web app or to a URI launching an app on iOS or Android.

  • The Reactor is an asynchronous rules engine that can implement complex rules.

The Redirector is best when you want to drive tailored user experiences from the web as a direct response to an action. For example:

  • Present personalized information to users after a product scan.
  • Open native apps and web apps based on the product the user scanned.
  • Launch the control application of a connected device.

Don't use the Redirector to:

  • Change incoming events.
  • Send incoming events to third party systems.
  • Trigger background services and execute complex instructions.

For these situations, use the Reactor. Reactor scripts are written in Javascript (Node.js), which is ideal for writing complex workflows that talk to other services, send actions, or change other Thngs. However, the Reactor doesn't return a value synchronously, so your users won’t get an instant reply.