         registerPrettyPicturesFeature()
         registerReallyLongListFeature()
         registerTodoListFeature()
+        startLiveService()
         
         return true
     }
     
     func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
         return open(viewURI: url, animated: true)
+    }
+    
+    func applicationWillEnterForeground(_ application: UIApplication) {
+        startLiveService()
+    }
+    
+    func applicationDidEnterBackground(_ application: UIApplication) {
+        hubManager.liveService?.stop()
+    }
+    
+    // MARK: - HUBLiveServiceDelegate
+    
+    func liveService(_ liveService: HUBLiveService, didCreateViewController viewController: UIViewController) {
+        prepareAndPush(viewController: viewController, animated: true)
     }
     
     // MARK: - Private

            return false
        }
        
        viewController.view.backgroundColor = .white
        navigationController?.pushViewController(viewController, animated: animated)
        
        return true
    }
}


        hubManager.actionRegistry.register(TodoListActionFactory(), forNamespace: TodoListActionFactory.namespace)
    }
    
    private func startLiveService() {
        #if DEBUG
        hubManager.liveService?.delegate = self
        hubManager.liveService?.start(onPort: 7777)
        #endif
    }
    
    // MARK: - Opening view URIs
    
    @discardableResult private func open(viewURI: URL, animated: Bool) -> Bool {
