-
Notifications
You must be signed in to change notification settings - Fork 160
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
[FIX] #134 addVolumeListener is not triggered on iOS 15 #139
[FIX] #134 addVolumeListener is not triggered on iOS 15 #139
Conversation
Thanks for a very useful package! |
You can use patch-package until it is merged. |
Thanks, @Shummy1991! Will try that! |
@@ -37,13 +38,14 @@ @implementation RCTSystemSetting { | |||
UISlider *volumeSlider; | |||
} | |||
|
|||
-(void)dealloc { |
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.
cool that you introduced dealloc() and removed the subscription in it 👍 I did same in our project as a band-aid/patch-package and found your solution later. Good job!
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.
lgtm
@c19354837 please publish a new release with this fix included. |
1 similar comment
@c19354837 please publish a new release with this fix included. |
@awcchungster would |
This doesn't work if the app goes into background and then into foreground. |
Issue
Number #134: iOS 15 addVolumeListener fix
The system volume observer is no longer working on iOS 15.
Steps for reproduce:
Expected behaviour:
Change of volume setting value is processed correctly
Current Result:
Hardware buttons volume change has no response.
NotificationCenter produces no notifications for key AVSystemController_SystemVolumeDidChangeNotification.
Problem:
There is an information on stackoverflow that observing of AVSystemController_SystemVolumeDidChangeNotification is no longer supported because it's a private API.
Solution
The solution is based on the answer: EWTDTHK2 commented on 3 Oct.
The correct approach is to add KVO observer for AVAudioSession instance for outputVolume keyPath.