var app = {
    // Application Constructor
    initialize: function() {
        document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
    },

    // deviceready Event Handler
    //
    // Bind any cordova events here. Common events are:
    // 'pause', 'resume', etc.
    onDeviceReady: function() {
        cordova.plugins.backgroundMode.setDefaults({
            title: "gSMS",
            text: "Se execută în fundal",
            icon: "ic_launcher",
            resume: true,
            hidden: false,
            bigText: "Se execută în fundal",
            color: undefined
        });
        cordova.plugins.backgroundMode.on('activate', function() {
            console.log("Background mode activated")
            cordova.plugins.backgroundMode.disableWebViewOptimizations();
            cordova.plugins.backgroundMode.disableBatteryOptimizations();
        });
        cordova.plugins.backgroundMode.enable();
        cordova.plugins.backgroundMode.overrideBackButton();
        cordova.plugins.powerManagement.dim(
            () => {
                console.log("Wakelock acquired");
            },
            () => {
                console.log("Failed to acquire wakelock")
            }
        );
        [
            "/native/android/vue/sim-worker.vue",
            "/native/android/vue/sender.vue"
        ].forEach(f => httpVueLoader.register(Vue, f));
        new Vue({
            el: '#app'
        });
    }
};

app.initialize();