All use cases

device.os

iPhone to the Store, Android to Play

A link points either to the App Store or to Play, never to both. Two rules and one mandatory rule solve it. A desktop in front of the shop window is the honest case for the last rule — not “other”.

Where it hangs
Sticker on the shop door, flyer, business card, packaging.
Why the paper stays
Two printed codes, and the wrong one is always the one on top of the display.

Live resolution

device.os = ios
geo.country = CHlang.primary = descan.count_total = 5310
  1. 1iOS
  2. 2Android
  3. alwaysOtherwise
https://apps.apple.com/app/hof

Operating system of the device

A square sticker on the glass door of a shop, carrying the code
The same code on every shot.Sticker on the shop door, flyer, business card, packaging.

The ruleset

Valid, storable, mandatory rule last.

Not a description of what the engine could do — this is the text a code carries. The first matching rule wins, and the last one always matches.

ruleset · version 1

{
  "rules": [
    {
      "when": { "device.os": { "eq": "ios" } },
      "then": { "type": "redirect", "url": "https://apps.apple.com/app/hof" }
    },
    {
      "when": { "device.os": { "eq": "android" } },
      "then": { "type": "redirect", "url": "https://play.google.com/store/apps/hof" }
    },
    {
      "when": "always",
      "then": { "type": "redirect", "url": "https://hof.app" }
    }
  ]
}

Reprinting is the expensive part. Stop doing it.