2
0
mirror of synced 2025-02-17 08:46:43 +00:00

[admob][android] Move RewardedEventTypes to statics

This commit is contained in:
Elliot Hesp 2017-05-27 17:27:22 +01:00
parent 9a944dffc5
commit e4ee402aef
2 changed files with 11 additions and 2 deletions

View File

@ -72,8 +72,13 @@ export default class RewardedVideo {
* @returns {null} * @returns {null}
*/ */
on(eventType, listenerCb) { on(eventType, listenerCb) {
if ((eventType !== 'onRewarded' || eventType !== 'onRewardedVideoStarted') && !statics.EventTypes[eventType]) { const types = {
console.warn(`Invalid event type provided, must be one of: ${Object.keys(statics.EventTypes).join(', ')}, onRewarded, onRewardedVideoStarted`); ...statics.EventTypes,
...statics.RewardedVideoEventTypes,
};
if (!types[eventType]) {
console.warn(`Invalid event type provided, must be one of: ${Object.keys(types).join(', ')}`);
return null; return null;
} }

View File

@ -67,4 +67,8 @@ export const statics = {
onAdClosed: 'onAdClosed', onAdClosed: 'onAdClosed',
onAdFailedToLoad: 'onAdFailedToLoad', onAdFailedToLoad: 'onAdFailedToLoad',
}, },
RewardedVideoEventTypes: {
onRewarded: 'onRewarded',
onRewardedVideoStarted: 'onRewardedVideoStarted',
},
}; };