XenInfo

XenInfo calls and usage


Introduction


This documentation is to help you create a XenHTML widget using XenInfo. XenHTML widgets are limited to the information they can provide. XenInfo solves this by injecting more useful info such as weather, battery stats and more.

Getting Started Scroll to top

You do not need to include any external frameworks to use XenInfo. If you have the tweak installed it will automatically detect any XenHTML widget(s) selected.

XenInfo does not work for widgets that require Legacy mode. This means XenInfo will not work if Legacy mode is enabled.

The Code Scroll to top

                                    
                                

mainUpdate This javascript function is called from the Tweak XenInfo. XenInfo will pass a parameter to this function letting it know what it is updating.

                                    
                                

type the parameter will send what it's updating. This is so you don't have to update all your elements you only need to update the elements that need updating.

                                    
                                

All the types that can be sent are. weather, statusbar, battery, reminders, events, music, and signinginfo

Info Passed Scroll to top

Weather Information

                                        
                                    
2.0 Additions
weather.address
returns an object with address info. geocoded address of the weather update's location. might only be accurate on iOS 11
weather.address.street
the housenumber + street this location corresponds to
weather.address.neighbourhood
the local area the location is within
weather.address.city
the city the location is within. e.g., London, New York, etc...
weather.address.zipCode
the postal code the location is within. e.g., 95014, NG1 7AA, ...
weather.address.county
the county the location is within. e.g., Nottinghamshire, Santa Clara ...
weather.address.state
current state the location is within. e.g., England (for UK users), California, ...
weather.address.country
country the location is in. e.g., United States, Germany, ...
weather.address.countryISOCode
country the location is within as a ISO code. e.g., US, DE, UK, ...
weather.sunsetTimeFormatted
formatted sunset time. e.g., 17:08 PM
weather.sunriseTimeFormatted
formatted sunset time. e.g., 07:16 AM
End 2.0 Additions
weather.city
info about the current city
weather.temperature
info about the current temperature
weather.low
Returns current low
weather.high
Returns current high
weather.feelsLike
info about the current feels like temperature
weather.condition
info about the current condition
weather.naturalCondition
A detailed string about the current weather conditions
weather.dayForecasts
This is an object that needs to be parsed to return upcoming forecast. JSON.parse(weather.dayForecasts);
weather.hourlyForecasts
This is an object that needs to be parsed to return upcoming hourly forecast. JSON.parse(weather.hourlyForecasts);
weather.latlong
Returns latitude and longitude
weather.celsius
returns true or false
weather.conditionCode
Returns a number for condition. This can be used for icons or converting to text.
weather.updateTimeString
Returns the last time weather was updated.
weather.humidity
Returns current humidity.
weather.dewPoint
Returns current dewpoint.
weather.windChill
Returns current wind chill.
weather.windDirection
Returns wind direction in degrees
weather.windSpeed
Returns current wind speed.
weather.visibility
Returns current visiblility.
weather.sunsetTime
Returns sunset time
weather.precipitation24hr
Returns precipitation in last 24hrs
weather.heatIndex
Returns heatIndex
weather.moonPhase
Returns moonPhase
weather.pressure
Returns pressure
weather.sunriseTime
Returns sunrise time
weather.chanceofrain
Returns current chance of rain

Statusbar Information

                                        
                                    
signalBars
Returns amount of signal bars
signalNetworkType
Returns LTE, 3G, 2G, etc..
signalName
Returns operator name
wifiStrength
Returns wifi strength
wifiBars
Returns amount of wifi bars
wifiName
Returns current wifi name
bluetooth
Returns true/false

Battery Information

                                        
                                    
batteryPercent
Returns current percent
batteryCharging
Returns true/false
ramFree
Returns free ram
ramUsed
Returns current ram used
ramAvailable
Returns available ram
ramPhysical
Returns physical ram

Alarm Information

                                        
                                    
2.0 Additions
alarms
This object is an array of alarm entries, each with the following data:
alarms[0].title
title of the alarm
alarms[0].body
the text content of the alarm, either 'Alarm' (needs translating) or user-set in Clock app.
alarms[0].nextFireDateTimestamp
the next fire date of the alarm (either the first fire time, or next one after snoozing), as a UNIX timestamp
alarms[0].nextFireDateTimeParsed
The above, but parsed to e.g., 10:14am
alarms[0].nextFireDateDayParsed
The above, but parsed to e.g., Tuesday
alarms[0].allowSnooze
whether this alarm allows snoozing
alarms[0].repeatingFromSnoozed
whether this alarm is re-scheduled due to the user hitting snooze
End 2.0 Additions
alarmString
Returns alarm time
alarmDay
Returns number for the day the alarm is set for
alarmHour
Returns the hour for the alarm
alarmMinute
Returns the minute for the alarm (may have to append a 0 if less than 10)
When using an alarm object you need to check if it exists. If it doesn't exist return an empty string.

System Information

                                        
                                    
deviceName
Returns name set in General/About
deviceType
Returns the type of device Example: (iPhone X)
systemVersion
Returns firmware version
twentyfourhour
Returns if user has 24hr selected in General/Date + Time
ipAddress
Returns device local ip
notificationShowing
Returns yes or no if a notification is showing on the LS.

Music Information

                                        
                                    
artist
Returns current artist
album
Returns current album
title
Returns current title
isplaying
Returns true/false
--
artwork image is located at /var/mobile/Documents/Artwork.jpg

Event Information

                                        
                                    
events
events is an object that contains multiple entries based on how many events
2.0 Additions
events[0].title
Title of the calendar entry
events[0].location
User-set location of the calendar entry
events[0].isAllDay
Whether the event is set to cover the entire day
events[0].date
formatted calendar date, e.g., 11/23/18, 23/11/18 (UK style), etc
events[0].startTimeTimestamp
start time of the calemdar event, as a UNIX timestamp
events[0].endTimeTimestamp
end time of the calemdar event, as a UNIX timestamp
events[0].associatedCalendarName
The title of the calendar this event is found on
events[0].associatedCalendarHexColor
The in-app colour of the calendar this event is found on, as a hex code (includes the #)
End 2.0 Additions

Reminder Information

                                        
                                    
2.0 Additions
reminders
reminders is an object that contains multiple entries based on how many events
reminders[0].title
title of the reminder
reminders[0].dueDate
formatted reminder fire date, e.g., 11/23/18, 23/11/18 (UK style), etc
reminders[0].dueDateTimestamp
reminder fire date as a UNIX timestamp
reminders[0].priority
the priority value of the reminder. Maps the to !/!!/!!! selector in the Reminders app
End 2.0 Additions

Calling from widget

                                        
                                    
window.location = 'xeninfo:playpause';
Play/Pause music
window.location = 'xeninfo:nexttrack';
Next track music
window.location = 'xeninfo:prevtrack';
Previous track music
window.location = 'xeninfo:openapp:com.apple.mobilemail';
Open app
window.location = 'xeninfo:openurl:google.com';
Open's Safari to url
2.0 Additions
window.location = 'xeninfo:openspotlight';
Opens SB spotlight
window.location = 'xeninfo:consolelog:message';
Writes to console for debugging
End 2.0 Additions