### Basic In-app Event Examples Source: https://docs.appodeal.com/unity/advanced/event-tracking Examples of basic in-app event names used to track user activity. These events provide a general understanding of user actions within the application. ```text level1_finished level2_start app_login ``` -------------------------------- ### Start Test Activity for Adapter Integration (Kotlin) Source: https://docs.appodeal.com/android/advanced/testing Starts the Appodeal Test Activity for manual testing of third-party network adapters integration. Requires an activity context. ```kotlin Appodeal.startTestActivity(activity = activity) ``` -------------------------------- ### Rich In-app Event Examples with Parameters Source: https://docs.appodeal.com/unity/advanced/event-tracking Examples of rich in-app event names that include parameters for more detailed information. These events allow for capturing specific data points related to user actions. ```text level1_finished(result) level2_start(time) app_login(date) ``` -------------------------------- ### Verify Ad Viewability via Logs Source: https://docs.appodeal.com/android/ad-types/native Example of the log output generated when a native ad is successfully tracked as shown by the Appodeal SDK. ```text Appodeal com.example.app D Native [Notify Shown] ``` -------------------------------- ### Start Test Activity for Adapter Integration (Java) Source: https://docs.appodeal.com/android/advanced/testing Starts the Appodeal Test Activity for manual testing of third-party network adapters integration. Requires an activity context. ```java Appodeal.startTestActivity(activity); ``` -------------------------------- ### Get Consent Status Source: https://docs.appodeal.com/android/data-protection/gdpr-and-ccpa Retrieves the current consent status of the user after an update request has been processed. ```APIDOC ## Get Consent Status ### Description Returns the current consent status represented by the ConsentStatus enum. ### Method N/A (Getter) ### Endpoint ConsentManager.status ### Response #### Success Response - **ConsentStatus** (Enum) - One of: Unknown, Required, NotRequired, Obtained. ``` -------------------------------- ### Initialize Appodeal SDK (Manual Distribution) Source: https://docs.appodeal.com/unity/get-started?distribution=upm Initializes the Appodeal SDK using manual distribution. This method takes your app key, a bitmask of desired ad types, and an initialization listener. It's crucial to replace 'YOUR_APPODEAL_APP_KEY' with your actual key. ```csharp class Test : MonoBehaviour, IAppodealInitializationListener { private void Start() { int adTypes = Appodeal.INTERSTITIAL | Appodeal.BANNER | Appodeal.REWARDED_VIDEO | Appodeal.MREC; string appKey = "YOUR_APPODEAL_APP_KEY"; Appodeal.initialize(appKey, adTypes, this); } public void onInitializationFinished(List errors) {} } ``` -------------------------------- ### Get Predicted eCPM for Native Ads Source: https://docs.appodeal.com/ios/ad-types/native Retrieves the expected eCPM for a cached native ad based on historical data. This method helps in optimizing ad unit performance. ```Swift Appodeal.predictedEcpm(for: .nativeAd) ``` ```Objective-C [Appodeal isInitalizedForAdType: AppodealAdTypeNativeAd]; ``` -------------------------------- ### Activity Setup with RecyclerView and Appodeal (Kotlin) Source: https://docs.appodeal.com/android/ad-types/native Sets up the main activity for displaying native ads. It inflates the activity layout, creates and sets a `NativeListAdapter` for the RecyclerView, and initializes the Appodeal SDK. ```kotlin class NativeActivity : AppCompatActivity() { private val getNativeAd: () -> NativeAd? = { Appodeal.getNativeAds(1).firstOrNull() } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val binding = ActivityNativeBinding.inflate(layoutInflater) setContentView(binding.root) val nativeListAdapter = NativeListAdapter() binding.recyclerView.adapter = nativeListAdapter setUpAppodealSDK() } // ... other methods like obtainData, setUpAppodealSDK ... } ``` -------------------------------- ### Update Podfile for Appodeal SDK 3.0 Source: https://docs.appodeal.com/ios/upgrade-guide This snippet shows how to update your Podfile to integrate Appodeal SDK version 3.0. It replaces the older version, '~> 2.11', with '~> 3.0'. Manual installation steps are also provided. ```ruby # pod 'Appodeal', '~> 2.11' pod 'Appodeal', '~> 3.0' ``` -------------------------------- ### Initialize Appodeal SDK (UPM Distribution) Source: https://docs.appodeal.com/unity/get-started?distribution=upm Initializes the Appodeal SDK using the UPM distribution. This method takes your app key and a bitmask of desired ad types. It also sets up an event listener for initialization completion. ```csharp class Test : MonoBehaviour { private void Start() { int adTypes = AppodealAdType.Interstitial | AppodealAdType.Banner | AppodealAdType.RewardedVideo | AppodealAdType.Mrec; string appKey = "YOUR_APPODEAL_APP_KEY"; AppodealCallbacks.Sdk.OnInitialized += OnInitializationFinished; Appodeal.Initialize(appKey, adTypes); } public void OnInitializationFinished(object sender, SdkInitializedEventArgs e) {} } ``` -------------------------------- ### Update Podfile for Appodeal SDK 3.2.1 Source: https://docs.appodeal.com/ios/upgrade-guide This snippet demonstrates updating your Podfile to integrate Appodeal SDK version 3.2.1. It replaces the previous version with 3.2.1. Manual installation steps are also provided for users not utilizing CocoaPods. ```ruby # pod 'Appodeal', '~> 3.0' pod 'Appodeal', '~> 3.2.1' ``` -------------------------------- ### Initialize and Configure Appodeal SDK Source: https://docs.appodeal.com/unity/upgrade-guide Demonstrates the updated initialization and filtering methods using the new AppodealStack API constants. ```csharp Appodeal.Initialize(appKey, adTypes, listener); Appodeal.Cache(AppodealAdType.RewardedVideo); Appodeal.Show(AppodealShowStyle.BannerBottom); Appodeal.SetCustomFilter(PredefinedKeys.UserAge, 18); Appodeal.SetLocationTracking(false); Appodeal.ShowBannerView(AppodealViewPosition.VerticalBottom, AppodealViewPosition.HorizontalCenter, "default"); ``` -------------------------------- ### NativeAdView Programmatic Setup (Java) Source: https://docs.appodeal.com/android/ad-types/native This Java code illustrates how to programmatically link the various components of a NativeAdView. This is essential for dynamically configuring the ad view and ensuring all elements are correctly referenced. ```java nativeAdView.setCallToActionView(findViewById(R.id.callToActionView)); nativeAdView.setDescriptionView(findViewById(R.id.descriptionView)); nativeAdView.setIconView(findViewById(R.id.iconView)); nativeAdView.setMediaView(findViewById(R.id.mediaView)); nativeAdView.setRatingView(findViewById(R.id.ratingView)); nativeAdView.setAdAttributionView(findViewById(R.id.ad_attribution)); ``` -------------------------------- ### Update Podfile for Appodeal SDK 3.2 Source: https://docs.appodeal.com/ios/upgrade-guide This code snippet illustrates the necessary change in your Podfile to upgrade to Appodeal SDK version 3.2. It replaces the older SDK version with 3.2. Manual installation instructions are available for those not using CocoaPods. ```ruby # pod 'Appodeal', '~> 3.0' pod 'Appodeal', '~> 3.2' ``` -------------------------------- ### NativeAdView Programmatic Setup (Kotlin) Source: https://docs.appodeal.com/android/ad-types/native This Kotlin code demonstrates how to programmatically associate the required and optional views with a NativeAdView instance. It ensures that the ad view is correctly configured for displaying native ads. ```kotlin nativeAdView.callToActionView = findViewById(R.id.callToActionView) nativeAdView.descriptionView = findViewById(R.id.descriptionView) nativeAdView.iconView = findViewById(R.id.iconView) nativeAdView.mediaView = findViewById(R.id.mediaView) nativeAdView.ratingView = findViewById(R.id.ratingView) nativeAdView.adAttributionView = findViewById(R.id.ad_attribution) ``` -------------------------------- ### Update Podfile for Appodeal SDK 3.3.0-beta.1 Source: https://docs.appodeal.com/ios/upgrade-guide This snippet shows how to update your Podfile to use Appodeal SDK version 3.3.0-beta.1. It replaces the older version with the new beta version. Ensure you follow the manual installation steps if not using CocoaPods. ```ruby # pod 'Appodeal', '~> 3.0' pod 'Appodeal', '~> 3.3.0-beta.1' ``` -------------------------------- ### Appodeal SDK Initialization (Kotlin) Source: https://docs.appodeal.com/android/ad-types/native Initializes the Appodeal SDK with specified parameters, including log level, testing mode, and the app key. It also sets up a callback for initialization results, logging success or any errors encountered. ```kotlin private fun setUpAppodealSDK() { Appodeal.setLogLevel(LogLevel.verbose) Appodeal.setTesting(true) Appodeal.initialize(this, APPODEAL_APP_KEY, Appodeal.NATIVE) { errors -> val initResult = if (errors.isNullOrEmpty()) "successfully" else "with ${errors.size} errors" Log.d("TAG", "onInitializationFinished: $initResult") } } ``` -------------------------------- ### Configure and Load Video Native Ads in Swift and Objective-C Source: https://docs.appodeal.com/ios/ad-types/native Configures and loads video native ads using APDNativeAdQueue. This setup includes defining the ad view class, autocache mask, and setting the ad type to 'video'. The delegate is also set for handling ad events. ```swift class ViewController: UIViewController { var adQueue : APDNativeAdQueue! override func viewDidLoad() { super.viewDidLoad() adQueue.settings.adViewClass = TemplateClass.self adQueue.settings.autocacheMask = [.icon, .media] adQueue.settings.type = .video adQueue.loadAd() } } ``` ```objectivec #import @interface YourViewController : UIViewController @property (nonatomic, strong) APDNativeAdQueue* nativeAdQueue; @property (nonatomic, strong) UIView * nativeAdView; @end @implementation YourViewController - (void)viewDidLoad { self.nativeAdQueue = [[APDNativeAdQueue alloc] init]; self.nativeAdQueue.settings.type = APDNativeAdTypeVideo; self.nativeAdQueue.settings.adViewClass = APDDefaultNativeAdView.class; self.nativeAdQueue.delegate = self; self.nativeAdQueue.settings.autocacheMask = APDNativeResourceAutocacheIcon | APDNativeResourceAutocacheMedia; [self.nativeAdQueue loadAd]; } @end ``` -------------------------------- ### Initialize Appodeal SDK with Consent Management Source: https://docs.appodeal.com/ios/data-protection/gdpr-and-ccpa Demonstrates the initialization of the Appodeal SDK in an iOS application delegate. This process automatically triggers the Stack Consent Manager if required and supports an optional initialization delegate. ```Swift @UIApplicationMain final class MyAppDelegate: UIResponder, UIApplicationDelegate, AppodealInitializationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil ) -> Bool { Appodeal.setAutocache(false, types: .interstitial) Appodeal.setLogLevel(.verbose) // New optional delegate for initialization completion Appodeal.setInitializationDelegate(self) /// Any other pre-initialization /// app specific logic Appodeal.initialize( withApiKey: "APP_KEY", types: .interstitial ) return true } func appodealSDKDidInitialize() { // Appodeal SDK did complete initialization } } ``` ```Objective-C @interface MyAppDelegate () @end @implementation MyAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [Appodeal setAutocache:NO types:AppodealAdTypeInterstitial]; [Appodeal setLogLevel:APDLogLevelVerbose]; // New optional delegate for initialization completion [Appodeal setInitializationDelegate:self]; /// Any other pre-initialization /// app specific logic [Appodeal initializeWithApiKey:@"APP KEY" types:AppodealAdTypeInterstitial]; return YES; } - (void)appodealSDKDidInitialize { // Appodeal SDK did complete initialization } @end ``` -------------------------------- ### Install and Update CocoaPods Dependencies Source: https://docs.appodeal.com/ios/get-started Commands to install or update CocoaPods dependencies. It includes instructions for installing CocoaPods if not already present and commands for cleaning caches and updating pods to resolve version conflicts. ```bash sudo gem install cocoapods pod install pod update rm -rf "${HOME}/Library/Caches/CocoaPods" rm -rf "`pwd`/Pods/" pod update ``` -------------------------------- ### Install Appodeal CMP Unity Plugin Source: https://docs.appodeal.com/unity/data-protection/gdpr-and-ccpa Instructions to install the Appodeal CMP Unity Plugin using a Git URL in the Unity Package Manager. Ensure you have v3.2.1 or newer installed. ```text https://github.com/appodeal/cmp-unity-plugin.git#v2.0.0 ``` -------------------------------- ### Implement AppodealPurchaseDelegate Methods Source: https://docs.appodeal.com/ios/advanced/in-app-purchases Handles purchase events by implementing the AppodealPurchaseDelegate protocol. These methods receive purchase details upon success or error information upon failure. ```Swift extension AppDelegate: AppodealPurchaseDelegate { func didReceivePurchase(_ successPurchases: [String: Any]?) { print("[ROI360] successPurchases: ", successPurchases) } func didFailPurchase(_ error: (any Error)?) { print("[ROI360] failPurchases: ", error?.localizedDescription) } } ``` ```Objective-C @interface AppDelegate () @end @implementation AppDelegate - (void)didReceivePurchase:(NSDictionary * _Nullable)successPurchases { NSLog(@"[ROI360] successPurchases: %@", successPurchases); } - (void)didFailPurchase:(NSError * _Nullable)error { NSLog(@"[ROI360] failPurchases: %@", error.localizedDescription); } @end ``` -------------------------------- ### Initialize Appodeal SDK in AppDelegate Source: https://docs.appodeal.com/ios/get-started Implementation of the Appodeal SDK initialization within the application delegate. Includes configuration of log levels, autocaching, and initialization delegates for both Swift and Objective-C. ```Swift import Appodeal @UIApplicationMain final class MyAppDelegate: UIResponder, UIApplicationDelegate, AppodealInitializationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil ) -> Bool { Appodeal.setAutocache(false, types: .interstitial) Appodeal.setLogLevel(.verbose) Appodeal.setInitializationDelegate(self) Appodeal.initialize(withApiKey: "APP_KEY", types: .interstitial) return true } func appodealSDKDidInitialize() {} } ``` ```Objective-C #import @interface MyAppDelegate () @end @implementation MyAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [Appodeal setAutocache:NO types:AppodealAdTypeInterstitial]; [Appodeal setLogLevel:APDLogLevelVerbose]; [Appodeal setInitializationDelegate:self]; [Appodeal initializeWithApiKey:@"APP KEY" types:AppodealAdTypeInterstitial]; return YES; } - (void)appodealSDKDidInitialize {} @end ``` -------------------------------- ### Initialize Appodeal SDK and Configure Native Ads Source: https://docs.appodeal.com/android/ad-types/native Configures the Appodeal SDK with testing mode enabled and initializes native ad support. It includes a callback mechanism to handle initialization errors and logs the status. ```java private void setUpAppodealSDK() { Appodeal.setTesting(true); Appodeal.initialize(this, APPODEAL_APP_KEY, Appodeal.NATIVE, errors -> { if (errors == null || errors.isEmpty()) { Log.d(TAG, "onInitializationFinished: successfully"); } else { Log.d(TAG, "onInitializationFinished: with " + errors.size() + " errors"); } }); } ``` -------------------------------- ### Server-to-Server Reward Callback URL Example Source: https://docs.appodeal.com/android/ad-types/rewarded-video Example of a server-to-server callback URL structure for receiving reward information. The URL should be configured in the Appodeal dashboard and used to decrypt and validate reward data, ensuring unique transactions by checking the impression_id. ```url {http:/example.com/reward}?data1={data1}&data2={data2} ``` -------------------------------- ### Update Appodeal iOS SDK via CocoaPods Source: https://docs.appodeal.com/ios/upgrade-guide This snippet demonstrates how to update the Appodeal SDK version in your Podfile. Ensure you consult the CocoaPods integration guide for the latest pod versions. This method is suitable for various SDK upgrade paths. ```ruby # pod 'Appodeal', '~> 3.4.1' pod 'Appodeal', '~> 3.4.2' ``` ```ruby # pod 'Appodeal', '~> 3.4.0' pod 'Appodeal', '~> 3.4.1' ``` ```ruby # pod 'Appodeal', '~> 3.4.0-beta.2' pod 'Appodeal', '~> 3.4.0' ``` ```ruby # pod 'Appodeal', '~> 3.4.0-beta.1' pod 'Appodeal', '~> 3.4.0-beta.2' ``` ```ruby # pod 'Appodeal', '~> 3.3.2' pod 'Appodeal', '~> 3.4.0-beta.1' ``` ```ruby # pod 'Appodeal', '~> 3.3.1' pod 'Appodeal', '~> 3.3.2' ``` ```ruby # pod 'Appodeal', '~> 3.3.0' pod 'Appodeal', '~> 3.3.1' ``` ```ruby # pod 'Appodeal', '~> 3.3.0-beta.4' pod 'Appodeal', '~> 3.3.0' ``` ```ruby # pod 'Appodeal', '~> 3.3.0-beta.3' pod 'Appodeal', '~> 3.3.0-beta.4' ``` ```ruby # pod 'Appodeal', '~> 3.3.0-beta.2' pod 'Appodeal', '~> 3.3.0-beta.3' ``` ```ruby # pod 'Appodeal', '~> 3.2.1' pod 'Appodeal', '~> 3.3.0-beta.2' ``` -------------------------------- ### Configure CocoaPods Source Repository Source: https://docs.appodeal.com/ios/get-started Instructions for adding Appodeal's mirror repository as a source in your Podfile. This is useful if the official CocoaPods trunk repository is unresponsive or has issues. ```ruby source 'https://github.com/appodeal/CocoaPods.git' source 'https://cdn.cocoapods.org/' ``` -------------------------------- ### GET /api/v2/demo_log_files_urls Source: https://docs.appodeal.com/advanced/ad-revenue-attribution Retrieves a list of demo log files for testing purposes. ```APIDOC ## GET /api/v2/demo_log_files_urls ### Description Retrieves a list of demo log files to verify integration and data format. ### Method GET ### Endpoint https://api-services.appodeal.com/api/v2/demo_log_files_urls ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key. - **user_id** (string) - Required - Your user ID. ### Request Example https://api-services.appodeal.com/api/v2/demo_log_files_urls?api_key={your_api_key}&user_id={your_user_id} ``` -------------------------------- ### GET /websites/appodeal Source: https://docs.appodeal.com/reporting/reporting-api Retrieves statistics for apps, filtered by date, application, country, and network. ```APIDOC ## GET /websites/appodeal ### Description Retrieves statistics for apps, allowing filtering by date range, specific applications, countries, and ad networks. ### Method GET ### Endpoint /websites/appodeal ### Parameters #### Query Parameters - **date_from** (string) - Required - The first date to include statistics for, in 'YYYY-mm-dd' format. - **date_to** (string) - Required - The last date to include statistics for, in 'YYYY-mm-dd' format. Cannot be less than `date_from`. - **app[]** (string) - Optional - The application key to get statistics for or `ALL`. If omitted, statistics for all apps are calculated. - **country[]** (string) - Optional - The country ISO 2-characters code or `ALL`. Defaults to `ALL`. - **network[]** (string) - Optional - The network to get statistics for. Possible values include `ALL`, `adcolony`, `admob`, `directoffer`, `amazon`, `applovin`, and many others. Defaults to `ALL`. ### Request Example ```json { "example": "GET /websites/appodeal?date_from=2023-01-01&date_to=2023-01-31&app[]=ALL&country[]=US&network[]=admob" } ``` ### Response #### Success Response (200) - **statistics** (object) - An object containing the requested statistics. - **date** (string) - The date of the statistics. - **app_key** (string) - The key of the application. - **country** (string) - The country code. - **network** (string) - The ad network name. - **impressions** (integer) - The number of impressions. - **clicks** (integer) - The number of clicks. - **revenue** (float) - The generated revenue. #### Response Example ```json { "example": [ { "date": "2023-01-01", "app_key": "example_app_key", "country": "US", "network": "admob", "impressions": 10000, "clicks": 500, "revenue": 250.50 } ] } ``` ``` -------------------------------- ### Set Native Ad Callbacks Source: https://docs.appodeal.com/android/ad-types/native Sets up callbacks for various native ad events, including loading, failure to load, showing, show failure, clicks, and expiration. All callbacks are executed on the main thread. ```kotlin Appodeal.setNativeCallbacks(object : NativeCallbacks { override fun onNativeLoaded() { // Called when native ads are loaded } override fun onNativeFailedToLoad() { // Called when native ads are failed to load } override fun onNativeShown(nativeAd: NativeAd) { // Called when native ad is shown } override fun onNativeShowFailed(nativeAd: NativeAd) { // Called when native ad show failed } override fun onNativeClicked(nativeAd: NativeAd) { // Called when native ads is clicked } override fun onNativeExpired() { // Called when native ads is expired } }) ``` ```java Appodeal.setNativeCallbacks(new NativeCallbacks() { @Override public void onNativeLoaded() { // Called when native ads are loaded } @Override public void onNativeFailedToLoad() { // Called when native ads are failed to load } @Override public void onNativeShown(NativeAd nativeAd) { // Called when native ad is shown } @Override public void onNativeShowFailed(NativeAd nativeAd) { // Called when native ad show failed } @Override public void onNativeClicked(NativeAd nativeAd) { // Called when native ads is clicked } @Override public void onNativeExpired() { // Called when native ads is expired } }); ``` -------------------------------- ### Unity Editor Log Example for 65K Reference Limit Source: https://docs.appodeal.com/faq-and-troubleshooting/troubleshooting/unity-common-issues/65k-reference-limit This snippet shows an example of the error message logged in the Unity Editor when the number of method references exceeds the 65K limit. It indicates the total number of methods and the failure during the dex merging process. ```text stderr[ D8: Cannot fit requested classes in a single dex file (# methods: 136481 > 65536) FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':launcher:transformDexArchiveWithExternalLibsDexMergerForRelease'. > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html ``` -------------------------------- ### Show Ad with Placement (C#) Source: https://docs.appodeal.com/unity/ad-types/interstitial?distribution=manual Demonstrates how to display an ad for a specific placement using the Appodeal SDK in C#. Requires the Appodeal SDK to be initialized and an ad to be loaded for the specified placement. ```csharp Appodeal.Show(AppodealShowStyle.Interstitial, "placementName"); ``` -------------------------------- ### Subscribe to Rewarded Video Events via Delegates Source: https://docs.appodeal.com/unity/ad-types/rewarded-video Demonstrates how to subscribe to specific rewarded video ad events using the AppodealCallbacks delegate system in C#. This approach allows for granular control over individual event handlers. ```csharp public void SomeMethod() { AppodealCallbacks.RewardedVideo.OnLoaded += OnRewardedVideoLoaded; AppodealCallbacks.RewardedVideo.OnFailedToLoad += OnRewardedVideoFailedToLoad; AppodealCallbacks.RewardedVideo.OnShown += OnRewardedVideoShown; AppodealCallbacks.RewardedVideo.OnShowFailed += OnRewardedVideoShowFailed; AppodealCallbacks.RewardedVideo.OnClosed += OnRewardedVideoClosed; AppodealCallbacks.RewardedVideo.OnFinished += OnRewardedVideoFinished; AppodealCallbacks.RewardedVideo.OnClicked += OnRewardedVideoClicked; AppodealCallbacks.RewardedVideo.OnExpired += OnRewardedVideoExpired; } private void OnRewardedVideoLoaded(object sender, AdLoadedEventArgs e) { Debug.Log($"[APDUnity] [Callback] OnRewardedVideoLoaded(bool isPrecache:{e.IsPrecache})"); } private void OnRewardedVideoFailedToLoad(object sender, EventArgs e) { Debug.Log("[APDUnity] [Callback] OnRewardedVideoFailedToLoad()"); } private void OnRewardedVideoShowFailed(object sender, EventArgs e) { Debug.Log("[APDUnity] [Callback] OnRewardedVideoShowFailed()"); } private void OnRewardedVideoShown(object sender, EventArgs e) { Debug.Log("[APDUnity] [Callback] OnRewardedVideoShown()"); } private void OnRewardedVideoClosed(object sender, RewardedVideoClosedEventArgs e) { Debug.Log($"[APDUnity] [Callback] OnRewardedVideoClosed(bool finished:{e.Finished})"); } private void OnRewardedVideoFinished(object sender, RewardedVideoFinishedEventArgs e) { Debug.Log($"[APDUnity] [Callback] OnRewardedVideoFinished(double amount:{e.Amount}, string name:{e.Currency})"); } private void OnRewardedVideoClicked(object sender, EventArgs e) { Debug.Log("[APDUnity] [Callback] OnRewardedVideoClicked()"); } private void OnRewardedVideoExpired(object sender, EventArgs e) { Debug.Log("[APDUnity] [Callback] OnRewardedVideoExpired()"); } ``` -------------------------------- ### GET /api/v2/output_result Source: https://docs.appodeal.com/reporting/reporting-api Retrieves the generated statistics data for a completed task using the provided task_id. ```APIDOC ## GET /api/v2/output_result ### Description Retrieves the final statistics data once the task status indicates it is ready. The response will be a JSON file containing the requested statistics. ### Method GET ### Endpoint `https://api-services.appodeal.com/api/v2/output_result` ### Parameters #### Query Parameters - **api_key** (string) - Required - Your Appodeal API key. - **user_id** (string) - Required - Your Appodeal User ID. - **task_id** (string) - Required - The ID of the completed statistics task. - **disposition** (string) - Optional - Use `attachment` to download the file directly if the response is large. ### Request Example ```json { "api_key": "", "user_id": "", "task_id": "" } ``` ### Response #### Success Response (200) - **code** (integer) - Status code (0 for success). - **message** (string) - Status message (e.g., "success"). - **url** (string) - A link to download the statistics file if the response is large and `disposition=attachment` was used. - **data** (array) - An array containing the statistical data. Each element may include parameters like `requests`, `fills`, `impressions`, `fillrate`, `clicks`, `ctr`, `revenue`, `ecpm`, and optionally `app_key`, `app_name`, `country_code`, `network`, `date` based on the `detalisation` requested. #### Response Example ```json { "code": 0, "message": "success", "data": [ { "date": "2019-02-13", "app_key": "", "app_name": "Example App", "network": "Appodeal", "requests": 1000, "fills": 900, "impressions": 850, "fillrate": 0.90, "clicks": 50, "ctr": 0.0588, "revenue": 10.50, "ecpm": 12.35 } ] } ``` #### Error Response Example (Large File) ```json { "code": 0, "message": "success", "url": "" } ``` ``` -------------------------------- ### Add Appodeal and Bidon Adapters via CocoaPods Source: https://docs.appodeal.com/ios/get-started This snippet shows how to declare Appodeal and various Bidon network adapters as dependencies in your Podfile. These are essential for integrating different ad networks through Appodeal. ```ruby pod 'BidonAdapterBidMachine', '3.5.0.0' pod 'BidonAdapterBigoAds', '5.0.0.0' pod 'BidonAdapterChartboost', '9.10.1.0' pod 'BidonAdapterDTExchange', '8.4.1.0' pod 'BidonAdapterInMobi', '11.1.0.0' pod 'BidonAdapterIronSource', '9.1.0.0.0' pod 'BidonAdapterMetaAudienceNetwork', '6.20.1.0' pod 'BidonAdapterMintegral', '7.7.9.0' pod 'BidonAdapterMobileFuse', '1.9.3.0' pod 'BidonAdapterMoloco', '4.1.0.0' pod 'BidonAdapterMyTarget', '5.36.2.0' pod 'BidonAdapterStartIo', '4.12.0.0' pod 'BidonAdapterTaurusX', '1.9.2.0' pod 'BidonAdapterUnityAds', '4.16.3.0' pod 'BidonAdapterVungle', '7.6.2.0' pod 'BidonAdapterYandex', '7.17.0.0' # appodeal pod 'AppodealAdjustAdapter', '5.4.6.0' pod 'AppodealAmazonAdapter', '5.3.2.0' pod 'AppodealAppLovinAdapter', '13.5.1.0' pod 'AppodealAppLovinMAXAdapter', '13.5.1.0' pod 'AppodealAppsFlyerAdapter', '6.17.7.0' pod 'AppodealBidMachineAdapter', '3.5.0.0' pod 'AppodealBidonAdapter', '0.14.0.0' pod 'AppodealBigoAdsAdapter', '5.0.0.0' pod 'AppodealDTExchangeAdapter', '8.4.1.0' pod 'AppodealFacebookAdapter', '18.0.1.0' pod 'AppodealFirebaseAdapter', '12.4.0.0' pod 'AppodealGoogleAdMobAdapter', '12.13.0.0' pod 'AppodealIABAdapter', '3.4.7.0' pod 'AppodealInMobiAdapter', '11.1.0.0' pod 'AppodealIronSourceAdapter', '9.1.0.0.0' pod 'AppodealLevelPlayAdapter', '9.1.0.0.0' pod 'AppodealMetaAudienceNetworkAdapter', '6.20.1.0' pod 'AppodealMintegralAdapter', '7.7.9.0' pod 'AppodealMyTargetAdapter', '5.36.2.0' pod 'AppodealSentryAdapter', '8.57.2.0' pod 'AppodealUnityAdapter', '4.16.3.0' pod 'AppodealVungleAdapter', '7.6.2.0' pod 'AppodealYandexAdapter', '7.17.0.1' ``` -------------------------------- ### GET /api/v2/check_status Source: https://docs.appodeal.com/reporting/reporting-api Checks the status of a previously initiated statistics task using the provided task_id. ```APIDOC ## GET /api/v2/check_status ### Description Checks the status of a statistics generation task. Use this endpoint to determine if your requested data is ready for retrieval. ### Method GET ### Endpoint `https://api-services.appodeal.com/api/v2/check_status` ### Parameters #### Query Parameters - **api_key** (string) - Required - Your Appodeal API key. - **user_id** (string) - Required - Your Appodeal User ID. - **task_id** (string) - Required - The ID of the statistics task to check. ### Request Example ```json { "api_key": "", "user_id": "", "task_id": "" } ``` ### Response #### Success Response (200) - **code** (integer) - Status code (0 for success). - **message** (string) - Status message (e.g., "success", "pending"). #### Response Example ```json { "code": 0, "message": "success" } ``` ``` -------------------------------- ### GET GetConsentStatus Source: https://docs.appodeal.com/unity/data-protection/gdpr-and-ccpa Retrieves the current consent status of the user. ```APIDOC ## GET GetConsentStatus ### Description Returns the current consent status enum. ### Method GET ### Response #### Success Response (200) - **status** (Enum) - One of: Unknown, Required, NotRequired, Obtained. ``` -------------------------------- ### Initialize Appodeal SDK with Consent Callback (Kotlin) Source: https://docs.appodeal.com/android/data-protection/gdpr-and-ccpa Initializes the Appodeal SDK and handles the completion of the initialization process. This code snippet is for Kotlin and requires the Appodeal SDK. ```kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Appodeal.initialize(activity, appKey, adTypes, object : ApdInitializationCallback { override fun onInitializationFinished(list: List?) { //Appodeal initialization finished } }) } ``` -------------------------------- ### GET /api/v2/stats_api Source: https://docs.appodeal.com/reporting/reporting-api Retrieves performance statistics for a specified date range, allowing for custom data detailing. ```APIDOC ## GET /api/v2/stats_api ### Description Retrieves the same statistics available on the Appodeal Dashboard in JSON format. ### Method GET ### Endpoint https://api-services.appodeal.com/api/v2/stats_api ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key from the dashboard. - **user_id** (string) - Required - Your unique User ID from the dashboard. - **date_from** (string) - Required - Start date in YYYY-MM-DD format. - **date_to** (string) - Required - End date in YYYY-MM-DD format. - **detalisation[]** (array) - Optional - Fields to group the data by (e.g., date). ### Request Example https://api-services.appodeal.com/api/v2/stats_api?api_key=YOUR_API_KEY&user_id=YOUR_USER_ID&date_from=2019-05-13&date_to=2019-05-19&detalisation[]=date ### Response #### Success Response (200) - **data** (object) - The requested statistics object in JSON format. #### Response Example { "status": "success", "data": [ { "date": "2019-05-13", "revenue": 10.50 } ] } ``` -------------------------------- ### POST /api/v2/apps (Create) Source: https://docs.appodeal.com/reporting/reporting-api Endpoint to create a new application in the Appodeal dashboard. ```APIDOC ## POST /api/v2/apps ### Description Creates a new application entry. Do not include the 'app_key' parameter, otherwise the system will attempt to update an existing application instead. ### Method POST ### Endpoint https://api-services.appodeal.com/api/v2/apps ### Parameters #### Request Body - **platform** (integer) - Required - 1 for Google, 2 for Amazon, 4 for iOS. - **bundle_id** (string) - Required - The package name of the application. - **name** (string) - Optional - Name of the application. - **is_game** (integer) - Optional - 1 if game, 0 otherwise. - **orientation** (string) - Optional - 'both', 'landscape', or 'portrait'. - **is_for_kids** (integer) - Optional - 1 if aimed for kids, 0 otherwise. - **coppa** (integer) - Optional - 1 if COPPA compliant, 0 otherwise. - **filter_mature_content** (integer) - Optional - 1 to filter mature content, 0 otherwise. ### Request Example { "platform": 4, "bundle_id": "com.example.app", "name": "My Awesome App", "is_game": 0 } ### Response #### Success Response (200) - **status** (string) - Success confirmation. #### Response Example { "status": "success" } ``` -------------------------------- ### Get Bidon Endpoint Source: https://docs.appodeal.com/unity/advanced/self-hosted-bidon Retrieves the currently configured Bidon endpoint from the Appodeal SDK. ```APIDOC ## Get Bidon Endpoint ### Description Retrieves the currently set Bidon endpoint URL from the Appodeal SDK. ### Method `Appodeal.GetBidonEndpoint()` ### Endpoint N/A (This is an SDK method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript const currentEndpoint = Appodeal.GetBidonEndpoint(); ``` ### Response #### Success Response (string) Returns the URL of the currently configured Bidon endpoint. #### Response Example ```json "https://example.com/api" ``` ``` -------------------------------- ### Configure Podfile for Appodeal SDK Source: https://docs.appodeal.com/ios/get-started A standard Podfile configuration for iOS projects using Appodeal. It includes the necessary sources and a comprehensive list of mediation adapters for various ad networks. ```ruby platform :ios, '15.0' source 'https://github.com/appodeal/CocoaPods.git' source 'https://github.com/bidon-io/CocoaPods-Specs.git' source 'https://cdn.cocoapods.org' use_frameworks! def appodeal pod 'Appodeal', '4.0.0' # AppLovin MAX pod 'AppLovinMediationAmazonAdMarketplaceAdapter', '5.3.2.0' pod 'AppLovinMediationBidMachineAdapter', '3.5.0.0.0' pod 'AppLovinMediationBigoAdsAdapter', '5.0.0.0' pod 'AppLovinMediationByteDanceAdapter', '7.7.0.7.0' pod 'AppLovinMediationChartboostAdapter', '9.10.1.0' pod 'AppLovinMediationFacebookAdapter', '6.20.1.0' pod 'AppLovinMediationFyberAdapter', '8.4.1.0' pod 'AppLovinMediationGoogleAdManagerAdapter', '12.13.0.0' pod 'AppLovinMediationGoogleAdapter', '12.13.0.0' pod 'AppLovinMediationInMobiAdapter', '11.1.0.0' pod 'AppLovinMediationIronSourceAdapter', '9.1.0.0.0' pod 'AppLovinMediationMintegralAdapter', '7.7.9.0.0' pod 'AppLovinMediationMobileFuseAdapter', '1.9.3.0' pod 'AppLovinMediationMolocoAdapter', '4.1.0.0' pod 'AppLovinMediationMyTargetAdapter', '5.36.2.0' pod 'AppLovinMediationOguryPresageAdapter', '5.1.1.0' pod 'AppLovinMediationPubMaticAdapter', '4.10.0.0' pod 'AppLovinMediationSmaatoAdapter', '22.9.3.1' pod 'AppLovinMediationUnityAdsAdapter', '4.16.3.0' pod 'AppLovinMediationVerveAdapter', '3.7.0.0' pod 'AppLovinMediationVungleAdapter', '7.6.2.0' pod 'AppLovinMediationYandexAdapter', '7.17.0.0' # Level Play pod 'IronSourceAdMobAdapter', '5.3.0.0' pod 'IronSourceAppLovinAdapter', '5.3.0.0' pod 'IronSourceBidMachineAdapter', '5.1.0.0' pod 'IronSourceBigoAdapter', '5.1.0.0' pod 'IronSourceFacebookAdapter', '5.0.0.0' pod 'IronSourceFyberAdapter', '5.2.0.0' pod 'IronSourceInMobiAdapter', '5.3.0.0' pod 'IronSourceMintegralAdapter', '5.1.0.0' pod 'IronSourceMobileFuseAdapter', '5.0.0.0' pod 'IronSourceMolocoAdapter', '5.2.0.0' pod 'IronSourceMyTargetAdapter', '5.3.0.0' pod 'IronSourceOguryAdapter', '5.0.0.0' pod 'IronSourcePangleAdapter', '5.5.0.0' pod 'IronSourceSmaatoAdapter', '5.0.0.0' pod 'IronSourceUnityAdsAdapter', '5.2.0.0' pod 'IronSourceVerveAdapter', '5.1.0.0' pod 'IronSourceVungleAdapter', '5.3.0.0' # Bidon pod 'BidonAdapterAmazon', '5.3.2.0' pod 'BidonAdapterAppLovin', '13.5.1.0' end ``` -------------------------------- ### Check Ad Availability for Placement Source: https://docs.appodeal.com/unity/ad-types/rewarded-video Verifies if an ad is ready to be shown for a specific placement before attempting to display it to ensure optimal user experience. ```C# if(Appodeal.CanShow(AppodealAdType.RewardedVideo, "placementName")) { Appodeal.Show(AppodealShowStyle.RewardedVideo, "placementName"); } ``` ```Java if(Appodeal.canShow(Appodeal.REWARDED_VIDEO, "placementName")) { Appodeal.show(Appodeal.REWARDED_VIDEO, "placementName"); } ``` -------------------------------- ### Consent Form Management Source: https://docs.appodeal.com/unity/data-protection/gdpr-and-ccpa?distribution=manual Methods to load and display the consent form to the user. ```APIDOC ## METHOD ConsentManager.Instance.Load / Show ### Description Handles the loading and displaying of the consent form UI to the user. ### Method Internal SDK Method ### Parameters - None ### Response #### Success Response (Event) - **OnConsentFormLoadSucceeded** - Provides a ConsentForm object. - **OnConsentFormDismissed** - Triggered when the user closes the form. ``` -------------------------------- ### Subscribe to Banner Ad Events in Unity Source: https://docs.appodeal.com/unity/ad-types/banner?distribution=manual Demonstrates how to subscribe to banner lifecycle events using C# event delegates. This approach allows tracking events like loading, showing, and clicking by attaching methods to the AppodealCallbacks.Banner events. ```csharp AppodealCallbacks.Banner.OnLoaded += (sender, args) => { }; public void SomeMethod() { AppodealCallbacks.Banner.OnLoaded += OnBannerLoaded; AppodealCallbacks.Banner.OnFailedToLoad += OnBannerFailedToLoad; AppodealCallbacks.Banner.OnShown += OnBannerShown; AppodealCallbacks.Banner.OnShowFailed += OnBannerShowFailed; AppodealCallbacks.Banner.OnClicked += OnBannerClicked; AppodealCallbacks.Banner.OnExpired += OnBannerExpired; } private void OnBannerLoaded(object sender, BannerLoadedEventArgs e) { Debug.Log("Banner loaded"); } private void OnBannerFailedToLoad(object sender, EventArgs e) { Debug.Log("Banner failed to load"); } private void OnBannerShowFailed(object sender, EventArgs e) { Debug.Log("Banner show failed"); } private void OnBannerShown(object sender, EventArgs e) { Debug.Log("Banner shown"); } private void OnBannerClicked(object sender, EventArgs e) { Debug.Log("Banner clicked"); } private void OnBannerExpired(object sender, EventArgs e) { Debug.Log("Banner expired"); } ``` -------------------------------- ### GET Autocache Status Source: https://docs.appodeal.com/android/ad-types/interstitial Verifies if the autocache feature is enabled for the interstitial ad unit. ```APIDOC ## GET isAutoCacheEnabled ### Description Checks if autocache is enabled for the interstitial ad unit. ### Method GET ### Endpoint Appodeal.isAutoCacheEnabled(ad_type) ### Parameters #### Path Parameters - **ad_type** (constant) - Required - The type of ad (e.g., Appodeal.INTERSTITIAL) ### Response #### Success Response (200) - **boolean** - Returns true if autocache is enabled. ```