[admob][android] Move RewardedEventTypes to statics
This commit is contained in:
parent
9a944dffc5
commit
e4ee402aef
|
@ -72,8 +72,13 @@ export default class RewardedVideo {
|
|||
* @returns {null}
|
||||
*/
|
||||
on(eventType, listenerCb) {
|
||||
if ((eventType !== 'onRewarded' || eventType !== 'onRewardedVideoStarted') && !statics.EventTypes[eventType]) {
|
||||
console.warn(`Invalid event type provided, must be one of: ${Object.keys(statics.EventTypes).join(', ')}, onRewarded, onRewardedVideoStarted`);
|
||||
const types = {
|
||||
...statics.EventTypes,
|
||||
...statics.RewardedVideoEventTypes,
|
||||
};
|
||||
|
||||
if (!types[eventType]) {
|
||||
console.warn(`Invalid event type provided, must be one of: ${Object.keys(types).join(', ')}`);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,4 +67,8 @@ export const statics = {
|
|||
onAdClosed: 'onAdClosed',
|
||||
onAdFailedToLoad: 'onAdFailedToLoad',
|
||||
},
|
||||
RewardedVideoEventTypes: {
|
||||
onRewarded: 'onRewarded',
|
||||
onRewardedVideoStarted: 'onRewardedVideoStarted',
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue