You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using this library to handle media behavior in our app to pause/resume when a phone call starts/stops. Looking over Android documentation I came across this:
If the user receives a phone call, or if a user-configured alarm occurs, your app should pause any media playback until your app regains audio focus.
To support this functionality, don't declare the READ_PHONE_STATE permission. Instead, implement the onAudioFocusChange() event handler, which runs automatically when the system shifts its audio focus. Learn more about how to implement audio focus.
This project's README states that:
The package will request for READ_PHONE_STATE permission in android.
Given the above documentation, does that mean that the proper way to handle these events would be to use onAudioFocusChange() instead of requesting the READ_PHONE_STATE permission? And if so, would it be possible for this lib to be updated accordingly?
The text was updated successfully, but these errors were encountered:
scottg489-tw
changed the title
Is READ_PHONE_STATE necessary?
Migrate to using onAudioFocusChange() instead of READ_PHONE_STATE?
Mar 14, 2022
We're using this library to handle media behavior in our app to pause/resume when a phone call starts/stops. Looking over Android documentation I came across this:
https://developer.android.com/training/permissions/evaluating#pause-media
Which states:
This project's README states that:
Given the above documentation, does that mean that the proper way to handle these events would be to use
onAudioFocusChange()
instead of requesting theREAD_PHONE_STATE
permission? And if so, would it be possible for this lib to be updated accordingly?The text was updated successfully, but these errors were encountered: