Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a Connectivity.ConnectivityChanged handler does not work on Android 14 #19949

Closed
mikeluken opened this issue Jan 17, 2024 · 1 comment · Fixed by #19968
Closed

Adding a Connectivity.ConnectivityChanged handler does not work on Android 14 #19949

mikeluken opened this issue Jan 17, 2024 · 1 comment · Fixed by #19968
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/android 🤖 t/bug Something isn't working

Comments

@mikeluken
Copy link

Description

When targeting Android 14, the following event is never triggered when toggling Wi-Fi on/off:

Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged;

Steps to Reproduce

Create a new MAUI app targeting Android 14 (SDK 34). As of now, you will need to use the nightly releases because you can't use a ConnectivityChanged event with 8.0.3 while targeting SDK 34 or you will get an error.

In App.xaml.cs (in App constructor), add the following:

Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged;
private async void Connectivity_ConnectivityChanged(object sender, ConnectivityChangedEventArgs e)
{
    Console.WriteLine("Hitting here");
}

When toggling on/off wifi, the event is never triggered when targeting Android 14. It works fine if targeting Android 13.

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 14

Did you find any workaround?

Target SDK 33 (Android 13)

Relevant log output

No response

@Redth
Copy link
Member

Redth commented Feb 14, 2024

Fixed by #19968

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/android 🤖 t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants