Andrzej Mazur • @end3r • Enclave Games
meet.js Warsaw • March 18th 2014
"permissions": {
"contacts": {
"description": "Required for autocompletion in the share screen",
"access": "readcreate"
},
"alarms": {
"description": "Required to schedule notifications"
}
}
WebTelephony, Vibration API, WebSMS, Idle API, Screen Orientation, Settings API, Power Management API, Mobile Connection API, TCP Socket API, Geolocation API, WiFi Information API, Device Storage API, Contacts API, Mouse Lock API, Open WebApps, WebBluetooth, Network Information API, Battery Status API, Alarm API, Browser API, Time⁄Clock API, Web Activities, Push Notifications API, Permissions API, WebFM API, FileHandle API, Network Stats API, WebPayment, IndexedDB, Archive API, Ambient light sensor, Proximity sensor, SystemXHR, ...
window.navigator.vibrate(200);
checkOrientation = function() {
if(window.orientation == 0 || window.orientation == 180) {
// "please rotate your device"
}
else {
// "play the game"
}
}
document.addEventListener("visibilitychange", function() {
if(document.hidden) {
// "app is hidden"
}
else {
// "app is visible"
}
})
Freedom
var installapp = navigator.mozApps.install(manifestURL);
installapp.onsuccess = function(data) {
// "App is installed"
};
installapp.onerror = function() {
// "App wasn't installed, see installapp.error.name for info"
}
manifest.webapp
{
"name": "My App",
"description": "My description goes here",
"launch_path": "/",
"icons": {
"128": "/img/icon-128.png"
},
"developer": {
"name": "Your name or organization",
"url": "http://your-homepage-here.org"
},
"default_locale": "en"
}
App Manager
about:app-manager
https://developer.mozilla.org/en-US/docs/Tools/Firefox_OS_Simulator
Win Alcatel OTF with Firefox OS and the js13kGames t-shirt!
March 18th - March 28th, sponsored by Enclave Games. Details:
blog.end3r.com/263.