-
Notifications
You must be signed in to change notification settings - Fork 159
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
addVolumeListener is not triggered on iOS 15 beta #134
Comments
Follow the thread. Also on iOS 15 official release addVolumeListener is NOT triggered when physical volume buttons are pressed on a device. Package: |
Based on the following thread I am testing the KVO method:
With:
Add:
The above changes are based on https://stackoverflow.com/questions/43361599/react-native-catch-volume-buttons-press-not-for-volume-adjusting/43361738#43361738 Should work on iOS 15, but when the Volume is at max or min pressing the volume up or volume down button again will not trigger the event. |
@EWTDTHK2 Thanks for your fix. It works, but I do get an error when long-pressing the volume button:
I understand this problem, but don't know how to fix this, if anybody could help, that would be greatly appreciated. |
@Vollkorn01
|
Thanks for your quick reply @EWTDTHK2. I think it is actually related to another native module of mine, sorry for the confusion! |
Is this still a problem in the final iOS 15 version? |
yes |
I have another issue: When putting the app to the background and opening it again, the listener won't get called anymore. I could reproduce the problem with a freshly initiated react native project. No error logs appear in XCode. Do you have the same problem @EWTDTHK2 ? Appreciate any leads.. |
Didn't notice that until you pointed it out, thx for finding this problem. It seems I got the same issue also. I will see how to fix this. |
In responds to @Vollkorn01 issue with app going to background and listener does not work when going back to foreground, I am testing the following changes, please kindly help to see if it works. Feel free to let me know if there are other issues.
With:
Add:
|
Have same issue, |
could be an outdated xcode? |
same issue. any solution for this |
@AftabUfaq and @ionleu do you mind posting the full log of your compilation, I can't see which line the compiler shows where the error is located in this screen shot. |
Same issue is happening with my project. Anyone resolved it yet? |
@EWTDTHK2 check this PS: Thank you for looking into that |
Please try to add the following line:
below
see if it works? |
Seems that now build process was successful, but still no effects, listener and getVolume is working only on Android |
by the way are you testing on simulator or real device? this only works on real device as far as I know it might not work on simulator. |
@EWTDTHK2 ohh, testing on simulator, I'll test then on next week on real device. Thanks |
@EWTDTHK2 Tested on iPhone 12, iOS: 15.0.2, works like a charm. Thank you for your help. |
It works @EWTDTHK2! |
Thank you so much for your fix @EWTDTHK2 , it worked! Another issue I recognized is, when audio is playing (spotify in my case) and I open the app with the fix, the music stops. Do you have the same issue? |
I didn't test this yet, but I think it could likely have this issue. As both app trying to access the AVAudioSession resource. Did you try to disable this fix and see if the music would stops? If you go back to Spotify would you be able to start the music again? |
@EWTDTHK2 If you go back to Spotify would you be able to start the music again? But if I'm in the app and pull down the drawer and press play, it doesn't play. So as long as I'm in the app, I cannot play music. But to be honest, this is not a big issue for our app. There is another, more pressing issue for our app: Thanks for your continuous improvements, very appreciated! |
|
Anyone merge this Pull Request to make this library work for ios 15 please? |
vote for merging the PR #139 to let everybody use this fix. patch-package is not a pretty legit solution. |
@c19354837 could you please check and merge or give some other contributors merge rights? |
[FIX] #134 addVolumeListener is not triggered on iOS 15
I'm late. I've publish 1.8.0-alpha.0, and you can install by |
@c19354837 your listener triggered on every second time. So, now there are some skips |
@EWTDTHK2 , Thanks you solution really helped. But every time my apps goes into background and then foreground, It's creating more listeners.
|
@c19354837 do you plan to publish a new version with this fix? It's been a while, so I'm just curious. Thanks! |
Package:
"react-native-system-setting": "1.7.6".
Platform:
iOS
OS version:
15.0 beta
Issue:
SystemSetting.addVolumeListener listener is called when physical volume buttons are pressed on a device.
The text was updated successfully, but these errors were encountered: