amradaptervungle

Welcome to the documentation for AMR Adapter Vungle. This documentation will provide you with detailed information about how to use AMR Adapter Vungle, a plugin that allows you to integrate Vungle ads into your iOS and Android apps.

Table of Contents

Installation

To install AMR Adapter Vungle, follow the steps below:

1. Open your Terminal and navigate to your project's directory.
2. Run the command 'pod init' if you are using Cocoapods, or skip this step if not.
3. Open the Podfile and add 'pod 'AMRAdapterVungle'' to your target.
4. Save the Podfile and run the command 'pod install'.
5. Open your Xcode project and import the AMRAdapterVungle module.

Integration

To integrate AMR Adapter Vungle into your app, follow the instructions below:

Initialization

First, you need to initialize the AMR Adapter Vungle by calling the `initialize` method in your app’s initialization code:

AMRAdapterVungle.initialize(appId: "YOUR_VUNGLE_APP_ID")

To display banner ads using AMR Adapter Vungle, use the following steps:

// Step 1: Create an instance of VungleBannerAd and specify the ad placement
let bannerAd = VungleBannerAd(placementId: "YOUR_BANNER_PLACEMENT_ID")
// Step 2: Add the banner ad to your view
yourView.addSubview(bannerAd.view)
// Step 3: Load the banner ad
bannerAd.load()
// Step 4: Show the banner ad
bannerAd.show()

Interstitial Ads

To display interstitial ads using AMR Adapter Vungle, use the following steps:

// Step 1: Create an instance of VungleInterstitialAd and specify the ad placement
let interstitialAd = VungleInterstitialAd(placementId: "YOUR_INTERSTITIAL_PLACEMENT_ID")
// Step 2: Load the interstitial ad
interstitialAd.load()
// Step 3: Show the interstitial ad
interstitialAd.show()

Rewarded Video Ads

To display rewarded video ads using AMR Adapter Vungle, use the following steps:

// Step 1: Create an instance of VungleRewardedVideoAd and specify the ad placement
let rewardedVideoAd = VungleRewardedVideoAd(placementId: "YOUR_REWARDED_VIDEO_PLACEMENT_ID")
// Step 2: Load the rewarded video ad
rewardedVideoAd.load()
// Step 3: Show the rewarded video ad
rewardedVideoAd.show()

Test Mode

To enable test mode for AMR Adapter Vungle, follow the steps below:

AMRAdapterVungle.enableTestMode()

Callbacks

AMR Adapter Vungle provides several callbacks to track the status of ads. You can implement these callbacks in your app’s code:

// Banner Ad Callbacks
func vungleBannerAdDidLoad() {
    // Banner ad loaded successfully
}
func vungleBannerAdDidFailToLoad(withError error: Error) {
    // Banner ad failed to load with the specified error
}
func vungleBannerAdDidShow() {
    // Banner ad showed successfully
}
func vungleBannerAdDidFailToShow(withError error: Error) {
    // Banner ad failed to show with the specified error
}
// Interstitial Ad Callbacks
func vungleInterstitialAdDidLoad() {
    // Interstitial ad loaded successfully
}
func vungleInterstitialAdDidFailToLoad(withError error: Error) {
    // Interstitial ad failed to load with the specified error
}
func vungleInterstitialAdDidShow() {
    // Interstitial ad showed successfully
}
func vungleInterstitialAdDidFailToShow(withError error: Error) {
    // Interstitial ad failed to show with the specified error
}
// Rewarded Video Ad Callbacks
func vungleRewardedVideoAdDidLoad() {
    // Rewarded video ad loaded successfully
}
func vungleRewardedVideoAdDidFailToLoad(withError error: Error) {
    // Rewarded video ad failed to load with the specified error
}
func vungleRewardedVideoAdDidShow() {
    // Rewarded video ad showed successfully
}
func vungleRewardedVideoAdDidFailToShow(withError error: Error) {
    // Rewarded video ad failed to show with the specified error
}
func vungleRewardedVideoAdShouldReward() {
    // Rewarded video ad should be rewarded now
}
func vungleRewardedVideoAdDidComplete() {
    // Rewarded video ad completed successfully
}
func vungleRewardedVideoAdDidSkip() {
    // Rewarded video ad was skipped by the user
}

Error Handling

AMR Adapter Vungle has built-in error handling to help you handle potential issues. Use the following code to catch errors:

do {
    try AMRAdapterVungle.loadBannerAd(placementId: "YOUR_BANNER_PLACEMENT_ID")
} catch let error {
    // Handle the error
}

FAQ

Here are some frequently asked questions about AMR Adapter Vungle:

How do I obtain my Vungle app ID?

To obtain your Vungle app ID, log in to your Vungle account and navigate to the dashboard. Your app ID will be listed there.

How do I create ad placements in Vungle?

To create ad placements in Vungle, follow these steps:

  • Log in to your Vungle account and navigate to the dashboard.
  • Select your app from the list.
  • Click on the “Monetize” tab.
  • Click on the “Placements” tab.
  • Click on the “Create Placement” button.
  • Provide a name and select the ad type for the placement.
  • Save the placement.

How do I enable test mode?

Test mode can be enabled by calling the `enableTestMode` method in AMR Adapter Vungle.

AMRAdapterVungle.enableTestMode()

Is there a limit to the number of ads I can show?

There is no limit to the number of ads you can show using AMR Adapter Vungle.