pwa {shiny.pwa} | R Documentation |
Adds PWA support. Takes care of all the support required for browsers to recognize the application as a Progressive Web app.
Description
Adds PWA support. Takes care of all the support required for browsers to recognize the application as a Progressive Web app.
Usage
pwa(
domain,
title = "My Shiny PWA",
output = NULL,
icon = NULL,
color = "#000000",
offline_template = NULL,
offline_message = "Looks like you are offline :/"
)
Arguments
domain |
The base URL where the app is hosted |
title |
The title of your Shiny app |
output |
Relative folder where to create the service worker file. Usually corresponds to the folder used by shiny to serve static files, this folder must exist and is usually the www folder of your shiny project. |
icon |
Icon path to be used for the app, relative to the project root. Recommended size is 512x512px. If left NULL a default icon is provided. |
color |
Color of the app. Used to color the browser elements when the pwa is installed. |
offline_template |
Path to the offline template you want to use, relative to the project root folder. If left NULL the default template is used. |
offline_message |
When using the default offline page template defines the message to be displayed. |
Value
A UI definition that can be passed to the [shinyUI] function.
Note
For additional details on progressive web apps, visit https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps
Examples
if (interactive()){
library(shiny.pwa)
ui <- fluidPage(
pwa("https://myapp.com", output = "www")
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
}