Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bs4Dash & shiny.pwa integration #9

Open
agronomofiorentini opened this issue Dec 28, 2022 · 0 comments
Open

bs4Dash & shiny.pwa integration #9

agronomofiorentini opened this issue Dec 28, 2022 · 0 comments

Comments

@agronomofiorentini
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant