Learn R Programming

⚠️There's a newer version (2.0.1) of this package.Take me there.

shinyMobile

shiny API for Framework7 (IOS/android)

Installation

# for the latest version
devtools::install_github("RinteRface/shinyMobile")

Demo

A running demo is on shinyapps.io. Left side: android demo, right side: iOS demo

Progressive Web App (PWA)

Configuration

shinyMobile is PWA capable, meaning that it can be displayed full screen on many mobile devices. This feature is automatically handled by f7Page():

shiny::tags$meta(name = "apple-mobile-web-app-capable", content = "yes"),
shiny::tags$meta(name = "theme-color", content = "#2196f3"),
shiny::tags$meta(name = "apple-mobile-web-app-status-bar-style", content="black-translucent"),
shiny::tags$link(rel = "apple-touch-icon", href = "icons/apple-touch-icon.png"),
shiny::tags$link(rel = "icon", href = "icons/favicon.png"),
shiny::tags$link(rel = "manifest", href = "manifest.json"),

However to access launch icons and splatch screens, you must create a manifest.json file and an icon asset folder in the www folder of your app: more here.

The manifest.json file could be like:

{
  "name": "My App",
  "short_name": "My App",
  "description": "My App",
  "lang": "en-US",
  "start_url": "https://dgranjon.shinyapps.io/miniUI2Demo/",
  "display": "standalone",
  "icons": [
    {
      "src": "icons/128x128.png",
      "sizes": "128x128",
      "type": "image/png"
    },
    {
      "src": "icons/144x144.png",
      "sizes": "144x144",
      "type": "image/png"
    },
    {
      "src": "icons/152x152.png",
      "sizes": "152x152",
      "type": "image/png"
    },
    {
      "src": "icons/192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "icons/256x256.png",
      "sizes": "256x256",
      "type": "image/png"
    },
    {
      "src": "icons/512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}

Be sure to replace the start_url with your own url. Add also a custom name, even though this can be modified later when adding the PWA to your IOS apps.

Later, there will be a dedicated function that will create the manifest.json file as well as other necessary assets.

Add the PWA to your desktop Apps

Go to the url of your app. In this example this is: https://dgranjon.shinyapps.io/miniUI2Demo/. It opens like a classic web app.

  • Select the share button located in the bottom bar of your Iphone/Ipad.
  • Click on "Add to Home Screen"
  • Choose a relevant name and click on OK.
  • The app will be added to your IOS Apps. In case you want custom icons, replace the content of the www folder with your own.

Copy Link

Version

Install

install.packages('shinyMobile')

Monthly Downloads

671

Version

0.1.0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

David Granjon

Last Published

November 30th, 2019

Functions in shinyMobile (0.1.0)

f7ActionSheet

Create a framework7 action sheet
create_manifest

Create a manifest for your shiny app
f7BlockTitle

Create a Framework7 block title
f7BlockFooter

Create a Framework7 block footer
f7Accordion

Create a Framework7 accordion
f7ExpandableCard

Create a Framework7 expandable card
f7BlockHeader

Create a Framework7 block header
f7DatePicker

Create a Framework7 date input
f7Dialog

Create a Framework7 dialog window
f7Icon

Create a Framework7 icon
f7Init

Custom initialization
f7Fab

Create a Framework7 floating action button (FAB)
f7Navbar

Create a Framework7 Navbar
f7NavbarHide

Hide a framework7 navbar
f7Button

Create a Framework7 button
f7Float

Create a Framework7 float
f7FabClose

f7Card

Create a Framework7 card
f7Back

Create a framework 7 back button
f7AutoComplete

Create a Framework7 autocomplete input
f7Fabs

Create a Framework7 container for floating action button (FAB)
f7Chip

Create a Framework7 chips
f7NotFound

Utility to display an item when the search is unsuccessful.
f7Align

Create a Framework7 align
f7Flex

Create a Framework7 flex container
f7Items

f7Link

Create a Framework7 link
f7Message

Create a framework7 message
f7Messages

Create a Framework7 messages container
f7PanelMenu

Create a Framework7 sidebar menu
f7FabMorphTarget

Convert a tag into a target morphing
f7List

Create a framework 7 contact list
f7Notif

Create a Framework7 notification
f7ColorPicker

Create a Framework7 color picker input
f7Item

f7InsertTab

f7Gallery

Launch the shinyMobile Gallery
f7Col

Create a Framework7 column container
f7ListItem

Create a Framework 7 contact item
f7Appbar

Create a Framework 7 appbar
f7Gauge

Create a Framework7 gauge
f7Margin

Create a Framework7 margin
f7PhotoBrowser

Create a fremework7 photo browser
f7Picker

Create a Framework7 picker input
f7PopoverTarget

Define a popover target
f7SmartSelect

Create a Framework7 smart select
f7Slider

Create a f7 slider
f7ListGroup

Create a framework 7 group of contacts
f7TabLayout

Create a Framework7 page with tab layout
f7Popover

Create a framework 7 popover
f7ListIndexItem

Create a Framework 7 list index item
f7ListIndex

Create a Framework 7 list index
f7ProgressInf

Create a Framework7 infinite progress bar
f7Padding

Create a Framework7 padding
f7Page

Create a Framework7 page
f7Radio

Create an f7 radio button input
f7Found

Utility to display an item when the search is successful.
f7HideOnEnable

f7NavbarShow

Show a framework7 navbar
f7Next

Create a framework 7 next button
f7HideOnSearch

Utility to hide a given tag on search
f7Panel

Create a Framework7 panel
f7Password

Create an f7 password input
f7checkBoxGroup

Create an f7 checkbox group input
f7checkBox

Create a F7 Checkbox
f7Tabs

Create a Framework7 tabs
updateF7Card

Update a framework 7 expandable card
f7Popup

Create a f7 popup
f7Progress

Create a Framework7 progress bar
f7Row

Create a Framework7 row container
f7RemoveTab

f7Sheet

Create an f7 sheet modal
f7PanelItem

Create a Framework7 sidebar menu item
f7SingleLayout

Create a Framework7 single layout
f7Skeleton

Create a Framework 7 skeleton loading overlay
f7Select

Create an f7 select input
f7Slide

Create a Framework7 slide
f7Searchbar

Create a Framework 7 searchbar
f7SearchIgnore

Utility to ignore an item from search.
f7SearchbarTrigger

Create a Framework 7 searchbar trigger
f7Swiper

Create a Framework7 swiper
f7Segment

Create a Framework7 segmented button container
f7Swipeout

Create a framework7 swipeout element
f7Stepper

Create a F7 radio stepper
f7SplitLayout

Create a Framework7 split layout
f7SocialCard

Create a Framework7 social card
f7Shadow

Create a Framework7 shadow effect
f7TapHold

Create a Framework7 tapHold event
f7SubNavbar

Create a Framework7 sub navbar
f7Text

Create an f7 text input
f7Tab

Create a Framework7 tab item
updateF7Checkbox

Change the value of a checkbox input on the client
f7Timeline

Create a Framework7 timeline
f7Toast

Create a Framework7 toast
f7TimelineItem

Create a Framework7 timeline item
updateF7AutoComplete

Change the value of an autocomplete input on the client
updateF7Sheet

update a framework 7 sheet modal
updateF7Progress

update a framework7 progress bar from the server side
updateF7Accordion

Update a Framework 7 accordion
getF7Colors

Function to get all colors available in shinyMobile
f7SwipeoutItem

Create a framework7 swipeout item
f7Tooltip

Create a Framework7 tooltip
f7Toolbar

Create a Framework7 Toolbar
updateF7Panel

f7Toggle

Create a F7 toggle switch
updateF7Picker

Change the value of a picker input on the client
updateF7Gauge

update a framework7 gauge from the server side
updateF7Tabs

Update a Framework 7 tabsetPanel
updateF7Fab

Change the value of a f7Fab input on the client
updateF7Slider

Change the value of a slider input on the client
updateF7Toggle

Change the value of a toggle input on the client
reexports

Objects exported from other packages
updateF7Text

Change the value of a text input on the client
updateF7Stepper

Change the value of a stepper input on the client
f7AccordionItem

Create a Framework7 accordion item
f7Block

Create a Framework7 block
f7Badge

Create a Framework7 badge