shiny.pwa
shiny.pwa copied to clipboard
bs4Dash & shiny.pwa integration
dear creator i tried to use shiny.pwa in combination with bs4dash and i notice that after deploying it online, i can't install the app on my phone.
While the same application with a fluidpage works perfectly and i can install it in my phone.
so I am asking you if I am doing something wrong or if it is impossible to perform the integration between bs4dash and shiny.pwa.
I report below the code I used in order to run the test between the two formats.
fluidpage with shiny.pwa
library(shiny)
library(shiny.pwa)
# Define UI for application that draws a histogram
ui <- fluidPage(
shiny.pwa::pwa(domain = "https://user.shinyapps.io/app/",
output = "inst/app/www",
title = "fluidpage",
icon="inst/app/www/ic_launcher.png",
offline_message = "You are offline :/"),
# Application title
titlePanel("Hello Shiny!"),
sidebarLayout(
# Sidebar with a slider input
sidebarPanel(
sliderInput("obs",
"Number of observations:",
min = 0,
max = 1000,
value = 500)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
}
# Run the application
shinyApp(ui = ui, server = server)
bs4Dash with shiny.pwa
library(shiny)
library(bs4Dash)
library(shiny.pwa)
# Define UI for application that draws a histogram
ui <- bs4Dash::dashboardPage(
shiny.pwa::pwa(domain = "https://user.shinyapps.io/app/",
output = "inst/app/www",
title = "bs4dash",
icon="inst/app/www/ic_launcher.png",
offline_message = "You are offline :/"),
title = "App bs4dash & shiny.pwa",
fullscreen = FALSE,
header = bs4DashNavbar(title = div(class = "img-rounded img-responsive",
id = "img-id",
align="center",
img(src = "https://i.ibb.co/NZ8qZsk/111111.png",
height = '35px',
width = '35px')),
rightUi = tagList(),
compact = TRUE),
sidebar = bs4DashSidebar(collapsed = FALSE),
controlbar = dashboardControlbar(),
footer = dashboardFooter(left = "App bs4dash & shiny.pwa"),
body = bs4DashBody()
)
# Define server logic required to draw a histogram
server <- function(input, output) {
}
# Run the application
shinyApp(ui = ui, server = server)