set_pwa: Utils to set up a PWA compatible structure

View source: R/pwa.R

set_pwaR Documentation

Utils to set up a PWA compatible structure

Description

Creates a web manifest, service-worker.js, icons and set the necessary dependencies. The app must be part of a package. Must not be used from the package root but from the app root.

Usage

set_pwa(
  path,
  name = "My Progressive Web App",
  shortName = "My App",
  description = "What it does!",
  lang = "en-US",
  startUrl = "/",
  display = c("standalone", "minimal-ui", "fullscreen", "browser"),
  background_color = "#ffffff",
  theme_color = "#ffffff",
  register_service_worker = TRUE,
  create_dependencies = TRUE
)

Arguments

path

App path.

name

App name.

shortName

App short name.

description

App description

lang

App language (en-US by default).

startUrl

Page to open at start.

display

Display mode. Choose among c("minimal-ui", "standalone", "fullscreen", "browser"). In practice, you want the standalone mode so that the app looks like a native app.

background_color

The background_color property is used on the splash screen when the application is first launched.

theme_color

The theme_color sets the color of the tool bar, and may be reflected in the app's preview in task switchers.

register_service_worker

Whether to register the service worker. Default to TRUE. Don't change the file name of service-worker.js!!!

create_dependencies

Default to TRUE. Relevant if used in a shinyMobile context. If used outside, you must set it to FALSE and handle the dependencies yourself.


RinteRface/charpente documentation built on July 21, 2024, 9:28 a.m.