Check internet on Api calling


#1

I want to check if internet is available when calling an api in the app


#2

if(navigator.onLine) // returns true


#3

First we should check internet connection is true or not.Then next line call Api in the same function.But this is true or not. I don’t know. Please try it


#4

How we check internet connection is true or false?


#5

Here i have attached my sample application refer coding.where you want to use this coding paste it,Try it.This is Ionic v3.https://github.com/Karthikaivel/Inertnetcheck