Supersonic.device.network.whenOnline - whenOffline not work


#1

Hi,

I have this problem with whenOnline() and whenOffline():

supersonic.device.network.whenOnline()
supersonic.js:30112 Uncaught ReferenceError: network is not defined
at Object.whenOnline (http://localhost/components/supersonic/supersonic.js:30112:14)
at :2:27
at Object.InjectedScript._evaluateOn (:895:140)
at Object.InjectedScript._evaluateAndWrap (:828:34)
at Object.InjectedScript.evaluate (:694:21)whenOnline @ supersonic.js:30112(anonymous function) @ VM170:2InjectedScript._evaluateOn @ VM81:895InjectedScript._evaluateAndWrap @ VM81:828InjectedScript.evaluate @ VM81:694
supersonic.device.network.whenOffline()
supersonic.js:30077 Uncaught ReferenceError: network is not defined
at Object.whenOffline (http://localhost/components/supersonic/supersonic.js:30077:14)
at :2:27
at Object.InjectedScript._evaluateOn (:895:140)
at Object.InjectedScript._evaluateAndWrap (:828:34)
at Object.InjectedScript.evaluate (:694:21)


#2

Are you calling it after supersonic.device.ready.then(...)?

http://docs.appgyver.com/supersonic/api-reference/stable/supersonic/device/ready/


#3

hi @BenStyles,

yes, and it does not work.

This began to happen since steroids update.


#4

Sounds like a bug to me. I would roll back to a previous version of steroids


#5

We’ll need to take a look. Thanks for the report.

In the meantime, could you try if you execute your whenOnline watcher in the Safari inspector after the view has loaded? (since in that context Cordova’s deviceready event must have already been fired)


#6

hi @Petrus_Repo,

I work in Win 8.1 and perform debugging on google chrome, and neither works.


#7

Am experiencing the same issue but mine is whenOffline.
Uncaught ReferenceError: network is not defined - undefined:undefined from the log.

How else can i check to know if device is offline?


#8

I had the same problem, but I found this solution http://docs.appgyver.com/en/edge/cordova_connection_connection.md.html#Connection

It works fine for me!


#9

Are you experiencing this on iOS or Android or both?


#10

On Android, but choose to follow the advice of @Fotios_Floros


#11

Any update on this on guys??

Out of no where this happens to me today!!!


#12

The same happens here when I download and run the kitchensink app: https://github.com/AppGyver/supersonic-kitchensink
The “network” object is undefined in steroids.js
Is there anybody working on this?


#13

Did you try this solution ?


#14

Yes, I read that. But I also figured out that the “whenOffline()” and “whenOnline()” features work only until supersonic 1.7.10. After that release they’re broken.The kitchensink app updates to supersonic 1.x (currently 1.13.1) so the network status page can’t really work. Please AppGyver superheros, can you look into that and fix the API? Otherwise you’ll end up with Captain Hindsight lecturing developers about supersonic bugs :wink:


#15

Did using the cordova method fixed your problem ?


#16

I modified the kitchensink bower.json file, that solved the problem.
{
“name”: “kitchensink”,
“version”: “0.0.0”,
“private”: true,
“dependencies”: {
“angular”: “1.3.x”,
“supersonic”: “1.7.2”,
“chartjs”: "git@github.com:nnnick/Chart.js.git#v1.0.1-beta.4"
},
“resolutions”: {
“webcomponentsjs”: “0.7.12”
}
}