How to check if meteor-mobile-cordova app is offline


#1

I want to show an alert to the user that they aren’t connected to the internet while in a mobile phone meteor-cordova app - but I can’t seem to find how to achiee this.

Does anyone have any ideas on how to do this?


#2

You can use this

enabled: ->
  connected = false
  if Meteor.status()
    if Meteor.status().connected
      connected = true
  return connected

#3

Thank you @flean, this helps heaps!