<li>Call <code>stopApp()</code> when the session ends</li>
</ol>
<pre><code>function(input, output, session) {

  if (!interactive()) {
    session$onSessionEnded(function() {
      stopApp()
      q("no")
    })
  }
}</code></pre>
<p>If you forget to do this, users will complain that their icons are broken and rightly blame you for it (an R session will be running in the background hosting the app, but they will need to press ctrl + alt + delete and use their task manager to close it). <strong>Not cool</st