message  Send Feedback

AdEventType

Common event types for ads.

Properties


Properties

CLICKED

CLICKED: 'clicked';

The user clicked the advert.


CLOSED

CLOSED: 'closed';

The user closed the ad and has returned back to your application.


ERROR

ERROR: 'error';

The ad has thrown an error. See the error parameter the listener callback for more information.

Example

import { AdEventType } from '@react-native-firebase/admob';
advert.onAdEvent((type, error, data) => {
if (type === AdEventType.ERROR) {
console.log('Ad error:', error);
}
});

LEFT_APPLICATION

LEFT_APPLICATION: 'left_application';

The user has left your application (e.g. following the ad).

Be sure to pause any tasks on this event (such as music or memory intensive tasks).


LOADED

LOADED: 'loaded';

When an ad has loaded. At this point, the ad is ready to be shown to the user.

Example

import { AdEventType } from '@react-native-firebase/admob';
advert.onAdEvent((type,error,data) => {
if (type === AdEventType.LOADED) {
advert.show();
}
});

OPENED

OPENED: 'opened';

The ad opened and is currently visible to the user. This event is fired after the show() method has been called.


React Native Market

Looking for pre-built React Native apps to kick start your next project? Check out the React Native Market by Invertase.

Your purchases help support our open-source projects such as React Native Firebase. All items are currently 50% off to celebrate the release of React Native Firebase version 6.
shopping_cartVisit React Native Market