-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Microsoft.Maui.Devices.Flashlight: Check if supported #13703
Conversation
Hey there @vividos! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D:\a\_work\1\s\src\Essentials\src\Flashlight\Flashlight.ios.cs(16,11): error CS0029: Cannot implicitly convert type 'bool' to 'System.Threading.Tasks.Task<bool>' [D:\a\_work\1\s\src\Essentials\src\Essentials.csproj::TargetFramework=net7.0-ios]
D:\a\_work\1\s\src\Essentials\src\Flashlight\Flashlight.ios.cs(16,11): error CS0029: Cannot implicitly convert type 'bool' to 'System.Threading.Tasks.Task<bool>' [D:\a\_work\1\s\src\Essentials\src\Essentials.csproj::TargetFramework=net7.0-maccatalyst]
69 Warning(s)
2 Error(s)
src/Essentials/samples/Samples/ViewModel/FlashlightViewModel.cs
Outdated
Show resolved
Hide resolved
src/Essentials/samples/Samples/ViewModel/FlashlightViewModel.cs
Outdated
Show resolved
Hide resolved
Thanks for all the review comments, I'll apply the changes on next Saturday |
Take your time @vividos ! Thank you for this! And thanks everyone for the input 😄 There was also 2 build errors:
|
Hi @vividos. We have added the "s/pr-needs-author-input" label to this issue, which indicates that we have an open question/action for you before we can take further action. This PRwill be closed automatically in 14 days if we do not hear back from you by then - please feel free to re-open it if you come back to this PR after that time. |
I fixed the iOS compile error (I changed the TargetFrameworks in Essentials.csproj a bit for compiling and was missing iOS errors) and also did the other requested changes. The PR should be ready now. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/// Checks if the flashlight is available and can be turned on or off. | ||
/// </summary> | ||
/// <returns><see langword="true"/> when the flashlight is available, or <see langword="false"/> when not</returns> | ||
public Task<bool> CheckIsSupportedAsync() => Task.FromResult(IsSupported); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this API be only IsSupportedAsync
? @mattleibow @Redth ?
so
IsSupported = await Flashlight.IsSupportedAsync();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already discussed this in #13458 and didn't come to a consent. So please discuss the name and I'll change that afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsSupportedAsync sounds good too!
@jfversluis How do we proceed with this PR? Someone has to decide how to name that method... |
I'm in favor of losing the Check. So just |
No problem, I'll rename the method. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Thank you for another wonderful PR @vividos ! |
Minor changes were requested which are addressed
🚨 API change(s) detected @davidbritch FYI |
You're welcome |
Description of Change
This adds the
CheckIsSupported()
call to theMicrosoft.Maui.Devices.Flashlight
API, as discussed in #13458.Issues Fixed
Fixes #13458
@jfversluis Feel free to change the name of the added method. In #13458 we didn't have a clear consent what name to use. Thanks!