A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pedrocoutinhosilva/shiny.pwa below:

pedrocoutinhosilva/shiny.pwa: Progressive Web Apps for r/shiny

Bring the power of Progressive web apps into your shiny dashboards! Allow users to install your dashboards allowing them to behave like a standalone application, both in desktop and mobile.

Try it out here: https://sparktuga.shinyapps.io/shinypwa/. If on mobile, or using chrome on desktop, you should be able to install and try out the PWA installation. Check the readme section Using PWAs for more information.

WARNING: Its important to note that PWAs are only available under the https protocol.

1 - Install the package:

from CRAN:

install.packages('shiny.pwa')

from github:

devtools::install_github('pedrocoutinhosilva/shiny.pwa')

2 - Include the library into your project:

# global.R
library(shiny.pwa)

3 - Call the pwa function in your UI definition, in any place you could add UI elements (for example mainPanel in a fluidPage):

# ui.R
ui <- fluidPage(
  titlePanel("Hello Shiny!"),
  sidebarLayout(
    sidebarPanel(...),
    mainPanel(
      pwa("https://myapp.com", output = "www"),
      ...
    )
  )
)

The following options are available:

4 - If you prefer to not generate the service worker every time your app starts, you can omit the output attribute from the pwa() function and instead run createServiceWorker(output_folder) to generate a pwa.service-worker.js file. This file does not need to be added as a dependency to your UI but must be available under https://yourapp.com/pwa.service-worker.js. The easiest way to achieve this with shiny is to add it to your www folder.

4 - That's it!

User experience depends on the OS and browser.

On desktop (Unix, MAC or Windows) you can use chrome to install the PWA as a standalone application. This can be done via the install button on the address bar:

It will then be available in standalone mode and show as a normal installed application:

On mobile you can use chrome, firefox or safari to install the PWA. On the first visit you will see a prompt for installation, on the following visits each browser has its own standards, for example chrome has the option available under "Add to home" in the right top corner options menu, firefox displays a + button on the address bar.

After installing the app will show and behave on your home screen as a normal mobile application.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4