FrontPage

FrontPage calls and usage


Introduction


This documentation is to help you create a FrontPage theme. FrontPage applies a WKWebview to the iOS homescreen. Along with the webview, it calls code within the html to supply iOS info such as battery, music, apps, switcher, signal, wifi, notifications, and other info. The code it calls is covered below.

Getting Started Scroll to top

FrontPage requires you to have a screenshot.jpg which is the screenshot of your theme, Info.plist, and index.html.

Info.plist Scroll to top

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                                    
                                    
                                          width
                                          auto
                                          height
                                          auto
                                          x
                                          0
                                          y
                                          0
                                          usessysteminfo
                                          <true/>
                                          usesbatteryinfo
                                          <true/>
                                          usesstatusbarinfo
                                          <true/>
                                          usesswitcherinfo
                                          <true/>
                                          usesappsinfo
                                          <true/>
                                          usesnotificationinfo
                                          <true/>
                                          usesfolderinfo
                                          <true/>
                                          usesalarminfo
                                          <true/>
                                          usesweatherinfo
                                          <true/>
                                          usesmusicinfo
                                          <true/>
                                    
                                    
                               

Width: can be set to an interger value or auto. If set to an interger still put it in <string></string>

Height: can be set to an interger value or auto. If set to an interger still put it in <string></string>

X: can be set to an interger such as fromright:100 which will move the theme 100px from the right. fromleft:100 will move 100px from the left. Center can also be set which will center depending on width

Y: can be set to an interger such as fromtop:100 which will move the theme 100px from the top. frombottom:100 will move 100px from the bottom. Center can also be set which will center depending on height

usesXXXinfo can be set to <true/> or <false/> this defines if FrontPage will send this info to your html.

index.html : Functions that receive Scroll to top

                                    
                                

FPI is your main object. All info is stored in this object. It is called whenever iOS info changes. Then the functions below are called to let you know that info was updated. For this there is no reason to have timers checking if info is changed.

                                    
                                

Depending on what you have enabled in your Info.plist each one of these functions are called when that info is updated. Here is an example to load device name into a div.

                                    
                                

loadSystem()

calls when device is unlocked. It sends this info.

FPI.system.twentyfour If a user has 24hr time set.
FPI.system.deviceName User name set in settings.
FPI.system.systemVersion System Version
FPI.system.firmwareBuild FirmwareBuild
FPI.system.firmware Firmware
FPI.system.systemName iPhone/iPad
FPI.system.serial Serial # (fake)
FPI.system.deviceType iPhone
FPI.system.model iPhone6
FPI.system.events Calendar events object
FPI.system.rootStorage Root storage size
FPI.system.rootfreeStorage Root storage free size
FPI.system.mobileStorage Mobile storage size
FPI.system.mobilefreeStorage Root storage free size
FPI.system.totalStorage Total storage size
FPI.system.freeStorage Free storage size

loadBattery()

calls when battery info is updated

FPI.battery.percent Battery percent without the % sign.
FPI.battery.chargetext returns Charging or Not Charging text.
FPI.battery.chargestate returns 0 or 1.

loadStatusBar()

calls when statusbar is updated

FPI.statusbar.wifiName wifi name.
FPI.statusbar.wifiRSSI wifi RSSI.
FPI.statusbar.wifiBars wifi bar count.
FPI.statusbar.signalName carrier name.
FPI.statusbar.signalStrength signal strength.
FPI.statusbar.signalBars signal bar count.
FPI.statusbar.bluetoothEnabled bluetooth Enabled

loadSwitcher()

calls when switcher is updated

FPI.switcher.bundles bundle id of apps in switcher

loadApps()

calls when apps are updated

FPI.apps.all returns all apps installed
FPI.apps.all[NUMBER].bundle returns bundle of app
FPI.apps.all[NUMBER].name returns name of app
FPI.apps.all[NUMBER].systemApp returns if app is a system app
FPI.apps.all[NUMBER].bundle returns bundle of app
FPI.bundle[BUNDLEID].badge get badge for certain bundle
FPI.bundle[BUNDLEID].name get name for certain bundle

loadMusic()

calls when music is updated

FPI.music.album returns current album
FPI.music.title returns current title
FPI.music.artist returns current artist
FPI.music.isPlaying returns if music is playing
FPI.music.musicBundle returns bundle of the current app playing music
FPI.music.albumArt returns album art

loadNotifications()

calls when notifications come in

FPI.notifications returns object of all notifications

loadFolders()

calls on reload

FPI.folderplist returns object of plist
/var/mobile/Library/SpringBoard/IconSupportState.plist
/var/mobile/Library/SpringBoard/IconState.plist

loadAlarms()

calls when alarms are added or removed

FPI.alarm.allalarms[COUNT].time returns alarm time
FPI.alarm.allalarms returns all alarms as object

loadMemory()

called once, then needs called to refresh

FPI.memory.ramUsed returns ram used
FPI.memory.ramFree returns free ram
FPI.memory.ramAvailable returns available ram
FPI.memory.ramPhysical returns physical ram

loadWeather()

called when weather is updated

FPI.weather.city returns city name
FPI.weather.naturalCondition returns string of current condition
FPI.weather.condition returns condition string
FPI.weather.latlong returns latitude and longitude
FPI.weather.temperature returns current temp
FPI.weather.conditionCode returns yahoo condition code number
FPI.weather.updateTimeString returns last time weather was updated
FPI.weather.humidity returns humidity
FPI.weather.dewPoint returns dewpoint
FPI.weather.windChill returns windchill
FPI.weather.feelsLike returns feels like temperature
FPI.weather.windDirection returns wind direction
FPI.weather.windSpeed returns wind speed
FPI.weather.visibility returns visibility
FPI.weather.sunsetTime returns when sun will set
FPI.weather.sunriseTime returns when sun will rise
FPI.weather.precipitationForecast no idea
FPI.weather.low returns current low
FPI.weather.high returns current high
FPI.weather.celsius returns if celsius
FPI.weather.chanceofrain returns chance of rain percent
FPI.weather.dayForecasts returns forecast in an object each forecast has low, high, dayNumber, icon, and dayOfWeek.

FPILoaded()

calls once when everything is updated on load good place to load clocks

deviceUnlocked()

calls when device is unlocked

deviceLocked()

calls when device is locked

viewRotated(direction)

calls when device is rotated it sends the direction in the parameter

loadSettings(settings)

returns a plist that was requested

badgeUpdated(bundle)

calls when an app badge is updated, it sends the bundle as a parameter.

loadReminders()

loads when device is unlocked

FPI.reminders.all returns array of reminders.

index.html : Functions that call Scroll to top

These functions call the tweak to do specific actions. They are used by setting window.location to a string. Example

                                    
                                

'frontpage:refreshWeather'

manually updates the weather

'frontpage:openApp:' + BUNDLEID;

opens an app by bundle

'frontpage:nexttrack'

changes track

'frontpage:prevtrack'

changes track

'frontpage:loadSettings:' + 'var/mobile/Documents/FrontPage.plist'

loads a plist and sends it back to loadSettings();

'frontpage:uninstallApp:' + bundle

uninstalls app by bundle

'frontpage:sleep'

puts device to sleep

'frontpage:respring'

resprings device

window.location = 'frontpage:enablebluetooth';

enables bluetooth

window.location = 'frontpage:disablebluetooth';

disables bluetooth

'frontpage:enablewifi'

enables wifi

'frontpage:disablewifi'

disables wifi

'frontpage:opensearch'

opens spotlight search

'frontpage:opencc'

opens control center

'frontpage:opennc'

opens notification center

'frontpage:updatememory'

updates memory and calls loadMemory()

'frontpage:vibrate'

will vibrate device

'frontpage:openappdrawer'

will open appdrawer if installed from cydia

'frontpage:opensiri'

will launch siri

'frontpage:openswitcher'

will launch switcher

'frontpage:openURL:' + url

will open url in safari

'frontpage:hidespringboardicons'

will hide springboard icons if shown

'frontpage:showspringboardicons'

will show springboard icons if shown

window.location = 'frontpage:setWidth:' + 270;

sets FrontPage width manually

window.location = 'frontpage:setWidth:' + 270;

sets FrontPage width manually

window.location = 'frontpage:opensearch';

open search on sb