#Amplify Datastore does not sync after coming back from airplane mode

2 messages · Page 1 of 1 (latest)

heavy cliff
#

Trying this:

Amplify.Hub.subscribe(
            HubChannel.DATASTORE,
            { it.name == DataStoreChannelEventName.NETWORK_STATUS.toString() },
            {
                val networkStatus = it.data as NetworkStatusEvent
                Log.i(tag, "User has a network connection? ${networkStatus.active}")
                if (networkStatus.active) {
                    // synchronize after active status
                    launchEvent(MainEvent.SyncDatabase)
                }
            }
        )

It detects when i activate airplane mode, but not when I deactivate it

heavy cliff
#

bump