Skip to content

Commit

Permalink
feat: add ability to run in background without UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jquick-axway committed Jun 3, 2020
1 parent ac742a1 commit bdccc4f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Alloy/template/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ global.Backbone = Backbone;

__MAPMARKER_ALLOY_JS__

Alloy.createController('index');
// Open root window if a new UI session has started. Can happen more than once in app's lifetime.
// Event can only be fired if "tiapp.xml" property "run-in-background" is set true.
Ti.UI.addEventListener('sessionbegin', function () {
Alloy.createController('index');
});

// Open the root window immediately if an active UI session exists on startup.
// Note: The Ti.UI.hasSession property was added as of Titanium 9.1.0.
if ((typeof Ti.UI.hasSession === 'undefined') || Ti.UI.hasSession) {
Alloy.createController('index');
}

0 comments on commit bdccc4f

Please sign in to comment.