JSON Structure
Open Web App (Mozilla)
Firefox OS
Firefox for android
Firefox Browser
What is the manifest for?
{
"version": "0.0.1",
"name": "tech-session1",
"description": "The minimalist tech session 1 app!",
"icons": {
"48": "tech-session1.gif"
},
"developer": {
"url": "",
"name": "Mark"
},
"launch_path": "index.html",
"default_locale": "en",
"activities": {
"dhis": {
"href": "*"
}
}
}
{
"activities":{
"dhis":{
"href":"https://apps.dhis2.org/demo"
}
}
Server modifies the special property
{
"activities":{
"dhis":{
"href": "*"
}
}
fetch('manifest.webapp', {credentials: 'same-origin'})
.then(function (response) { return response.json(); })
.then(function (manifest) {
var baseUrl = manifest.activities.dhis.href;
var apiUrl = [baseUrl + 'api'].join('/');
//Start your app here
//Add the baseUrl to your app (Load any core assets if required)
console.log(baseUrl);
})
.catch(function () {
console.log('Failed to load manifest');
});
Depends on what kind of app (or script)
/api/apps/<appName>
Chrome apps for JSON Views with style
/api/schemas.json?fields=name,href
A lot of endpoints can be found through
/api/resources.json
or
github.com/dhis2/inf5750-example