Add setApplicationMuted and setApplicationVolume methods#228
Add setApplicationMuted and setApplicationVolume methods#228rdlabo merged 5 commits intocapacitor-community:masterfrom
Conversation
Properly handle invalid parameters (reject, don't crash)
distante
left a comment
There was a problem hiding this comment.
LGTM. The test can be called directly on Android Studio.
They need to be fixed yes, and I think something as important as a monitization plugin really need functional tests 😢.
Alas, due time and health constrains I am not able to look at them.
src/web.ts
Outdated
| console.log('setApplicationMuted'); | ||
| } | ||
|
|
||
| //TODO: setApplicationVolume takes an options object that should probably be logged as well. |
Properly log setApplicationVolume and setApplicationMuted calls on web
|
Alright, functions for all platforms are implemented and work fine for me, so I think this is ready to merge. Additionally, the functions properly handle invalid parameters by rejecting rather than crashing the app (whoopsies!) In the meantime (in case this or a similar PR takes a while to merge), |
|
@rdlabo if you are OK with the iOS part we can merge this. |
|
Just realized one very minor concern - the Android code rejects on an invalid options object, the iOS code uses the default value. The implementations should probably be brought in line. Any preference? (I lean towards reject) |
|
Alright. Implemented the reject behavior so iOS/Android are matching completely. |
|
Thanks for great work. looks good. I will merge it! |
|
I will version each library, so please wait a while for the release. |
|
released. @ecc521 Thanks your work! |
Adds methods for setApplicationMuted and setApplicationVolume, implementing #50. The simplest option to me seemed to be simply exposing the AdMob APIs directly here
I can't really figure out how the tests are setup (and they're barely necessary given the simplicity of these changes), so I'd appreciate if someone else could work those in.
Otherwise, all tests that passed with version 4.1.0 are working with this PR. Version 4.1.0 had 2 failed tests, ShowInterstitial. Should not try to call show when no Interstitial was prepared, and ShowRewardVideoAd. Should not try to call show when no Reward was prepared. These still fail with this PR (at least on my device), but none of the code related to either of these tests or methods has been changed (ie, not a regression)
Otherwise, I believe I'd done all the stuff with docs properly. There's a slight opportunity for improving the logging on the web code to log the options object that's passed, but that should be a trivial task to someone better acquainted with this library.