You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Laurent Zubiaur (JIRA)" <ji...@apache.org> on 2016/03/01 10:00:26 UTC

[jira] [Comment Edited] (CB-10733) deviceready not fired - OSX

    [ https://issues.apache.org/jira/browse/CB-10733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15173459#comment-15173459 ] 

Laurent Zubiaur edited comment on CB-10733 at 3/1/16 8:59 AM:
--------------------------------------------------------------

Hi, the network plugin uses "exec" to call "NetworkStatus.getConnectionInfo" which of course is not implemented on the OSX platform. The problem is that the exec function doesn't call the error callback which is required to fire "deviceready". 

/// The plugin waits for onCordovaConnectionReady
   channel.waitForInitialization('onCordovaConnectionReady');

/// Here it calls the plugin native getConnectionInfo
   NetworkConnection.prototype.getInfo = function(successCallback, errorCallback) {
       exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []);
   };

/// On error the plugin fire onCordovaConnectionReady so deviceready is still called
   function (e) {
        // If we can't get the network info we should still tell Cordova
        // to fire the deviceready event.
        if (channel.onCordovaConnectionReady.state !== 2) {
            channel.onCordovaConnectionReady.fire();
        console.log("Error initializing Network Connection: " + e);
  }



was (Author: laurentzubiaur):
Hi, the network plugin uses "exec" to call "NetworkStatus.getConnectionInfo" which of course is not implemented on the OSX platform. The problem is that the exec function doesn't to call the error callback which is required to fire "deviceready". 

/// The plugin waits for onCordovaConnectionReady
   channel.waitForInitialization('onCordovaConnectionReady');

/// Here it calls the plugin native getConnectionInfo
   NetworkConnection.prototype.getInfo = function(successCallback, errorCallback) {
       exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []);
   };

/// On error the plugin fire onCordovaConnectionReady so deviceready is still called
   function (e) {
        // If we can't get the network info we should still tell Cordova
        // to fire the deviceready event.
        if (channel.onCordovaConnectionReady.state !== 2) {
            channel.onCordovaConnectionReady.fire();
        console.log("Error initializing Network Connection: " + e);
  }


> deviceready not fired - OSX
> ---------------------------
>
>                 Key: CB-10733
>                 URL: https://issues.apache.org/jira/browse/CB-10733
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: OSX
>    Affects Versions: 6.0.0
>         Environment: Darwin 10.11.2, Xcode 7.2.1, cordova-plugin-network-information 1.2.0, platform osx 4.0.0
>            Reporter: Laurent Zubiaur
>            Assignee: Tobias Bocanegra
>              Labels: triaged
>
> Hi, deviceready is not fired on platform osx (4.0.0) when network plugin is installed (1.2.0). 
> Console:
> [Log] deviceready has not fired after 5 seconds. (cordova.js, line 974)
> [Log] Channel not fired: onCordovaConnectionReady (cordova.js, line 967)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org