Unable to get network connection after switching from wifi to cellular data


Hi folks

We’re facing the problem that we (sometimes) lose internet connection after entering or leaving our wifi and changing from/to cellular data. After that we’re unable to retrieve any data from a web api.

The following code shows how we handle network changes:

import { Network } from '@ionic-native/network';

export enum ConnectionStatus {

export class NetworkHelper {

    private status: BehaviorSubject<ConnectionStatus> = new BehaviorSubject(ConnectionStatus.Offline);

    constructor(public network: Network, public eventCtrl: Events) { 

    public initializeNetworkEvents() {
        this.network.onDisconnect().subscribe(() => {
            if (this.status.getValue() === ConnectionStatus.Online) {
                console.log('WE ARE OFFLINE');

        this.network.onConnect().subscribe(() => {
            if (this.status.getValue() === ConnectionStatus.Offline) {
                console.log('WE ARE ONLINE');

The only way so far to recover is to either turn on and off flight mode or restart the app manually. This of course is not acceptable for the user.

Did anybody face the same issue and knows how to solve it?

Thanks and best regards