Since

3.0.1

Provides an event to notify in case of connection is changed. In Android, notifier fires the subscribed event with cached value at the first launch. That enables to not miss any changes. Such as, changed value could be missed when application is frozen. However it can be checked by Device.Network.createNotifier#isInitialStickyNotification isInitialStickyNotification .

Example

import Network from '@smartface/native/device/network';
const notifier = new Network.Notifier();

notifier.subscribe((connectionType) => {
console.log("ConnectionType is " + connectionType);
});

Hierarchy

Properties

nativeObject: any
ios: Partial<{}>
android: Partial<NotifierAndroidProps>
subscribe: ((callback: ((type: ConnectionType) => void)) => void)

Type declaration

    • (callback: ((type: ConnectionType) => void)): void
    • Lets you to subscribe to network change event. You can pass any listener callback you want.

      Parameters

      Returns void

connectionTypeChanged: null | ((type: ConnectionType) => void)

Fires when the network connection changes.

Methods

  • This method stops receiving subcribed callback.

    Method

    unsubscribe

    Ios

    Android

    Since

    3.0.1

    Returns void

Generated using TypeDoc