apache / apache/cordova-plugin-network-information

Online not firing on iOS

Open
#72 4 comments 9 reactions 0 assignees View on GitHub
platform: ios support
Dominant language
Objective-C
Stars
465
Forks
339
PR merge metrics
No merged PRs in 30d

Description

Online event isn't firing on iOS.

Environment:
iOS iPhone 5 emulator. iOS version: 10.3.1
Also tried same thing on iOS iPhone 6s emulator with iOS 11.4
On physical iPhone 5 with iOS 11.4.1 everything seems to work. Does the plugin have problems in the emulator?

cordova platforms iOS 4.5.5

Steps to repeat:
cordova create test
cordova platforms add ios@latest
Add this to index.js:

```
onDeviceReady: function() {
this.receivedEvent('deviceready');

document.addEventListener("online", () => {
console.log("ONLINE")
}, false);
document.addEventListener("offline", () => {
console.log("OFFLINE")
}, false);
},
```

On the machine running the emulator turn off all network access.
>> At this point "OFFLINE" prints (good!)

Turn on network access on the computer running the emulator.
>> Expect to see "ONLINE" but I see nothing.

Contributor guide

Open the contributing guide

Research direction

Start with the minimal reproduction in index.js and run it on the listed iOS emulator versions using the stated network-off and network-on steps. Compare the emulator behavior with the physical iPhone result and inspect the plugin's iOS event handling. Done means determining whether the online event should fire after connectivity returns and documenting or correcting the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, objective-c
Domain
mobile-dev, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.