Glossary
API Key
A unique identifier that is provided by Spot Ads. The API key is required to authenticate your application and connect it to the Spot Ads service. You must include this key in your app to show ads.
Spot Ads
Spot Ads is a platform that provides rewarded advertisements to applications. These ads can be displayed to users, offering them rewards for watching ads. This integration allows developers to add rewarded ad functionality into their apps.
SpotAdsProvider
A React component that must wrap your application. It provides the context and necessary configuration for the Spot Ads library to work. The provider expects an `apiKey` prop, which is your Spot Ads API key.
useSpotAd
A custom React hook provided by the Spot Ads React library. It gives you access to the `spotAd` object, which contains methods to interact with Spot Ads, such as `showAd`. This hook is used to show ads and manage their behavior within your app.
showAd
A method that is used to display a rewarded ad to the user. It takes two parameters: `onSuccess` (a callback function that is executed when the user successfully watches the ad) and `onError` (a callback function that is executed if the ad fails to load or there’s an error).
onSuccess
A callback function passed to the `showAd` method. It is called when the ad is successfully shown and the user completes the ad view. This is where you define the reward logic for the user (e.g., granting in-game currency, access to premium content).
onError
A callback function passed to the `showAd` method. It is called if the ad fails to load, or if there’s any error showing the ad. It allows you to handle ad-related issues, such as displaying an error message or trying to show a different ad.
React Hook
A special function in React that allows developers to use state and lifecycle features in functional components. `useSpotAd` is an example of a React hook used to integrate the Spot Ads library into a functional React component.
Callback Function
A function that is passed into another function as an argument and is executed at a later time, typically when a specific event occurs. In the Spot Ads library, `onSuccess` and `onError` are examples of callback functions used to handle the success or failure of an ad display.
Last updated