cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Zubiaur (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-10733) deviceready not fired - OSX
Date Tue, 01 Mar 2016 09:03:18 GMT

    [ 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 9:02 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
{code:javascript}   
channel.waitForInitialization('onCordovaConnectionReady');
{code}

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

On error the plugin fire onCordovaConnectionReady so deviceready is still called
{code:javascript}   
   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);
  }
{code}



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 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


Mime
View raw message