xamarin/Essentials

Connectivity Event Connect/Disconnect Issue

jpmock opened this issue · 4 comments

Description

I am trying to use the Xamarin Essentials Connectivity events for iOS in a Xamarin Forms solution and when I register the event (Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged) it fires as expected when I disable the internet connection. It hits the handler and all is good.

However, the issue is when I re-enable the internet connection, nothing happens. No event is fired.

Also worth mentioning is that the only time the event is fired is when I first launch the app in a connected state and transition to a disconnected state.
If I launch the app in a disconnected state and transition to a connected state, no event is fired.

Steps to Reproduce

  1. Add Xamarin Essentials package to a Xamarin Forms app
  2. Add code to trigger connectivity event
  3. Run in iOS simulator and notice when disconnecting we get the event, but upon re-connection, no event is triggered.

Expected Behavior

Event should be triggered when we lose and internet connection, and when the internet connection is re-established.

Actual Behavior

Only the FIRST disconnect event is triggered and thereafter, no other connection or disconnect events are triggered.

Basic Information

  • Version with issue: 1.1.0
  • Last known good version:
  • IDE: VS2019 For Mac
  • Xamarin.Forms 3.6..0.264807
  • Platform Target Frameworks:
    • iOS: 12.2

Are you putting your mac into airplane mode to simulate this? I just tested this out on my iPhone 6 and was not able to reproduce it.

Hey James, thanks for the info. I was testing this using the iOS simulator and the network link conditioner. In additional to the link conditioner, I also tried disabling wifi and re-enabling it. I will try it on the physical device as well. If that is the only option, it should do, but it would be nice for it to work with the iOS simulator.

The iOS simulator is not an accurate representation of some of the APIs because it is just a simulator and not an emulator.

Closing as we are unable to reproduce on physical devices.