{"action":"opened","issue":{"url":"https://api.github.com/repos/ionic-team/ionic-native/issues/2317","repository_url":"https://api.github.com/repos/ionic-team/ionic-native","labels_url":"https://api.github.com/repos/ionic-team/ionic-native/issues/2317/labels{/name}","comments_url":"https://api.github.com/repos/ionic-team/ionic-native/issues/2317/comments","events_url":"https://api.github.com/repos/ionic-team/ionic-native/issues/2317/events","html_url":"https://github.com/ionic-team/ionic-native/issues/2317","id":294698405,"number":2317,"title":"Ionic Native - Network onchange() works incorrectly ios","user":{"login":"lordsteggu","id":1150753,"avatar_url":"https://avatars3.githubusercontent.com/u/1150753?v=4","gravatar_id":"","url":"https://api.github.com/users/lordsteggu","html_url":"https://github.com/lordsteggu","followers_url":"https://api.github.com/users/lordsteggu/followers","following_url":"https://api.github.com/users/lordsteggu/following{/other_user}","gists_url":"https://api.github.com/users/lordsteggu/gists{/gist_id}","starred_url":"https://api.github.com/users/lordsteggu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordsteggu/subscriptions","organizations_url":"https://api.github.com/users/lordsteggu/orgs","repos_url":"https://api.github.com/users/lordsteggu/repos","events_url":"https://api.github.com/users/lordsteggu/events{/privacy}","received_events_url":"https://api.github.com/users/lordsteggu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-06T10:03:19Z","updated_at":"2018-02-06T10:03:19Z","closed_at":null,"author_association":"NONE","body":"**I'm submitting a ...**  (check one with \"x\")\r\n[x] bug report\r\n[ ] feature request\r\n[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/\r\n\r\n**Current behavior:**\r\nThe issue is prevalent on ios only, I have created implemented a static global onChange().subscribe.\r\nFrom this I am checking whether network is 4g, 3g or wifi and perform certain actions accordingly.\r\n\r\nHowever on ios, the onChange is called before the actual value of the network information is updated, so when I go from having wifi to not having wifi, the change event is called, will say I still have wifi because it has not updated, if I turn it back on, it will say I have no wifi, but I do. \r\n\r\nIt is always out of sync.\r\n\r\nThis does not happen on android, it works as expected on android\r\n\r\nHere is a demo repo for you to test the issue https://github.com/lordsteggu/NetworkTest\r\n\r\n**Expected behavior:**\r\nThe ios  network change event is called after the network value has updated \r\n\r\n**Steps to reproduce:**\r\nInstall the repo above on both ios and android\r\nonce installed turn on and off the network - both 4g wifi etc... \r\nthere is an alert that informs you of the state of the network\r\nthis is using - this.network.type to check the network states\r\n\r\nIonic Info\r\n\r\n```\r\n @ionic/cli-utils  : 1.19.1\r\n    ionic (Ionic CLI) : 3.19.1\r\n\r\nglobal packages:\r\n\r\n    cordova (Cordova CLI) : not installed\r\n\r\nlocal packages:\r\n\r\n    @ionic/app-scripts : 3.1.8\r\n    Cordova Platforms  : none\r\n    Ionic Framework    : ionic-angular 3.9.2\r\n\r\nSystem:\r\n\r\n    Node : v8.4.0\r\n    npm  : 5.5.0\r\n    OS   : Windows 10\r\n\r\nEnvironment Variables:\r\n\r\n    ANDROID_HOME : not set\r\n\r\nMisc:\r\n\r\n    backend : pro \r\n```\r\n"}}
{"actor":{"display_login":"lordsteggu"}}