From 8467d5d760448aba48a8a890a62b1387d17db65e Mon Sep 17 00:00:00 2001
From: Matthew Hodgson <matthew@matrix.org>
Date: Wed, 11 May 2016 01:48:02 +0200
Subject: [PATCH] 302 to iTunes if you don't have the app installed

---
 src/vector/index.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/vector/index.js b/src/vector/index.js
index e3178c96..9f687eb6 100644
--- a/src/vector/index.js
+++ b/src/vector/index.js
@@ -182,6 +182,13 @@ window.onload = function() {
 }
 
 function loadApp() {
+    if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
+        if (confirm("Vector works much better on iOS as an app.  Switch to the app?")) {
+            window.location = "https://itunes.apple.com/us/app/vector.im/id1083446067";
+            return;
+        }
+    }
+
     console.log("Vector starting at "+window.location);
     if (validBrowser) {
         var MatrixChat = sdk.getComponent('structures.MatrixChat');