Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Online not firing on iOS #72

Open
danfleck opened this issue Sep 20, 2018 · 4 comments
Open

Online not firing on iOS #72

danfleck opened this issue Sep 20, 2018 · 4 comments

Comments

@danfleck
Copy link

danfleck commented Sep 20, 2018

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.

@imgoddqp
Copy link

have this issue been resolved?

@darkmoment0088
Copy link

I have the same setup and issue,
I found out that online event will be fired if you switch device to background and foreground.

@dmitry-stepanenko
Copy link

Have the same issue. Workaround by @darkmoment0088 works for me.

@darkmoment0088
Copy link

Have the same issue. Workaround by @darkmoment0088 works for me.

on some research, i found that it is only happened on certain iOS version. on iPad.
it does not happen on iOS12 and above.

hope this information is helpful for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants