signalapp / Signal-iOS

A private messenger for iOS.
https://signal.org
GNU Affero General Public License v3.0
10.6k stars 2.95k forks source link

Volume shutter no longer takes photo on iOS 17.3 #5739

Closed kalleboo closed 1 week ago

kalleboo commented 5 months ago

Bug description

Volume buttons no longer take photos from the camera view.

Steps to reproduce

Actual result: Volume buttons no longer take a photo, but instead adjust volume

Expected result: Volume buttons should take a photo

Device info

Device: iPhone 15 Pro Max

iOS version: iOS 17.3

Signal version: 6.57.0.13

The implementation of this uses private APIs. There was a report for this on the beta of 17.2 (#5711), but it was not present in the release version of 17.2. It looks to me that this has now actually broken in the public release version of 17.3.

The relevant code is here: https://github.com/signalapp/Signal-iOS/blob/main/Signal/src/util/VolumeButtons.swift

Miguel-Signal commented 5 months ago

Hi @kalleboo,

This is indeed a big that Apple introduced in iOS 17.3. Please observe how other 3rd party camera apps (WhatsApp, Snapchat) also experience this issue. Due to this I unfortunately can't give out a specific timeline for a resolution.

tplk commented 3 months ago

Hi @Miguel-Signal

FYI it still works in Telegram but their solution uses Objective C swizzling (not sure if it would be possible to integrate it into this project).

Here're related source files, maybe it could help!

https://github.com/TelegramMessenger/Telegram-iOS/blob/b77b6fb670ab9a4fd68dcd6cbf51522496f17e9d/submodules/Utils/VolumeButtons/Sources/VolumeButtons.swift

https://github.com/TelegramMessenger/Telegram-iOS/blob/ae998eb91ef05dfec5c5fa2dfa3c78371992a482/submodules/LegacyComponents/Sources/PGCameraVolumeButtonHandler.m#L61

bhuemer commented 3 months ago

Hi @Miguel-Signal

Apple has released a proper public API to handle these volume button events: https://developer.apple.com/documentation/avkit/avcaptureeventinteraction From a little bit of reverse engineering it also seems that this is also the API that their components are using these days (e.g. UIImagePickerController, etc.).

Apologies for not being able to provide a merge request, but I hope this helps.

stale[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 week ago

This issue has been closed due to inactivity.

tplk commented 4 days ago

Thanks for the info, @bhuemer!

I think I'll take a look at this and try to provide a PR in the near future.

schmuckistoffl commented 1 day ago

Awesome @tplk 🤘🏼thanks so much 🫶🏼 this is really a pain in the ass bug 🙈