How to use the cordova/channel.onCordovaReady function in cordova

To help you get started, we’ve selected a few cordova examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / cordova-amazon-fireos / test / assets / www / cordova.js View on Github external
channel.join(function() {
    
    platform.initialize && platform.initialize();

    // Fire event to notify that all objects are created
    channel.onCordovaReady.fire();

    // Fire onDeviceReady event once page has fully loaded, all
    // constructors have run and cordova info has been received from native
    // side.
    channel.join(function() {
        require('cordova').fireDocumentEvent('deviceready');
    }, channel.deviceReadyChannelsArray);

}, platformInitChannelsArray);
github Wizcorp / phonegap-plugin-wizAssets / platforms / android / assets / www / cordova.js View on Github external
cordova.addDocumentEventHandler('searchbutton');

        function bindButtonChannel(buttonName) {
            // generic button bind used for volumeup/volumedown buttons
            var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
            volumeButtonChannel.onHasSubscribersChange = function() {
                exec(null, null, "App", "overrideButton", [buttonName, this.numHandlers == 1]);
            };
        }
        // Inject a listener for the volume buttons on the document.
        bindButtonChannel('volumeup');
        bindButtonChannel('volumedown');

        // Let native code know we are all done on the JS side.
        // Native code will then un-hide the WebView.
        channel.onCordovaReady.subscribe(function() {
            exec(null, null, "App", "show", []);
        });
    }
};
github qualintitative / egoweb / app / platforms / ios / CordovaLib / cordova.js View on Github external
channel.join(function() {
    modulemapper.mapModules(window);

    platform.initialize && platform.initialize();

    // Fire event to notify that all objects are created
    channel.onCordovaReady.fire();

    // Fire onDeviceReady event once page has fully loaded, all
    // constructors have run and cordova info has been received from native
    // side.
    channel.join(function() {
        require('cordova').fireDocumentEvent('deviceready');
    }, channel.deviceReadyChannelsArray);

}, platformInitChannelsArray);
github katzer / cordova-plugin-local-notifications / platforms / windows / platform_www / cordova.js View on Github external
channel.join(function() {
    modulemapper.mapModules(window);

    platform.initialize && platform.initialize();

    // Fire event to notify that all objects are created
    channel.onCordovaReady.fire();

    // Fire onDeviceReady event once page has fully loaded, all
    // constructors have run and cordova info has been received from native
    // side.
    channel.join(function() {
        require('cordova').fireDocumentEvent('deviceready');
    }, channel.deviceReadyChannelsArray);

}, platformInitChannelsArray);
github forcedotcom / SalesforceMobileSDK-Android / external / cordova / cordova.js View on Github external
channel.join(function () {
    modulemapper.mapModules(window);

    platform.initialize && platform.initialize();

    // Fire event to notify that all objects are created
    channel.onCordovaReady.fire();

    // Fire onDeviceReady event once page has fully loaded, all
    // constructors have run and cordova info has been received from native
    // side.
    channel.join(function () {
        require('cordova').fireDocumentEvent('deviceready');
    }, channel.deviceReadyChannelsArray);

}, platformInitChannelsArray);
github qualintitative / egoweb / egowebMobile / platforms / ios / platform_www / cordova.js View on Github external
addConstructor: function(func) {
        channel.onCordovaReady.subscribe(function() {
            try {
                func();
            } catch(e) {
                console.log("Failed to run constructor: " + e);
            }
        });
    }
};
github kerrishotts / Mastering-PhoneGap-Code-Package / snippets / 09 / lib / plugins / cordova-plugin-file / www / browser / Preparing.js View on Github external
return;
    }

    fail("This browser does not support this function");
};

window.isFilePluginReadyRaised = function () { return eventWasThrown; };

window.initPersistentFileSystem(PERSISTENT_FS_QUOTA, function() {
    console.log('Persistent fs quota granted');
    quotaWasRequested = true;
}, function(e){
    console.log('Error occured while trying to request Persistent fs quota: ' + JSON.stringify(e));
});

channel.onCordovaReady.subscribe(function () {
    function dispatchEventIfReady() {
        if (entryFunctionsCreated && quotaWasRequested) {
            window.dispatchEvent(filePluginIsReadyEvent);
            eventWasThrown = true;
        } else {
            setTimeout(dispatchEventIfReady, 100);
        }
    }

    dispatchEventIfReady();
}, false);

});
github greenaddress / WalletCordova / platforms / android / platform_www / cordova.js View on Github external
addConstructor: function(func) {
        channel.onCordovaReady.subscribe(function() {
            try {
                func();
            } catch(e) {
                console.log("Failed to run constructor: " + e);
            }
        });
    }
};
github jolocom / smartwallet-app / wallet / platforms / android / platform_www / cordova.js View on Github external
addConstructor: function(func) {
        channel.onCordovaReady.subscribe(function() {
            try {
                func();
            } catch(e) {
                console.log("Failed to run constructor: " + e);
            }
        });
    }
};