Skip to main content

Posts

Showing posts from 2021

Check Internet Connectivity In Ionic 5 App

Hi all, in this example you can set a condition to check your internet is connected or not please follow the below steps First Create A new Project      ionic start AppName blank --type=angular           Note: In this example i used Tabs in App Now Create a Modal Page     ionic g page /modals/modal-page Now Create a Provider       ionic generate provider ConnectivityProvider     Note: Make sure your provider is present in Provider Array in app.module.ts file ConnectivityProvider: import { Injectable } from '@angular/core' ; import { Observable , fromEvent , merge , of } from 'rxjs' ; import { map } from 'rxjs/operators' ; @ Injectable ({ providedIn : 'root' }) export class ConnectivityProvider { public appIsOnline$ : Observable < boolean >; constructor () { this . initConnectivityMonitoring (); } private initConnectivityMonitoring () { if (! window || ! navigator ...