Internet connection is not always available, especially when people are moving around the city, on the train, or hiking in the mountains. A good user experience will inform the user when the connection is lost.
In this recipe, we will create an app that shows a message when a network connection is lost.
We need to create an empty app named
MaskNetwork. If you use a different name, make sure you use the same when registering the app.
For Android, add the following permission to your
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
index.android.jsfiles, remove the existing code, and add the following: ...