If you miss to Initialize the SDK, this method will fail to return a response.
To implement an Interstitial bidder object for GAM follow:
//1. import MesonWrapGAM
import MesonWrapGAM
//2. Create a GAMRequest object
private var gamRequest = GAMRequest()
//3. Create a MesonGAMInterstitial object and Init with adUnitId and adSize
private var mesonInt: MesonGAMInterstitial?
mesonInt = = MesonGAMInterstitial.init(adUnitId: #adUnitId)
//1. import MesonWrapGAM
@import MesonWrapGAM;
//2. Create and Init a GAMRequest object with credientials
@property(nonatomic,strong) GAMRequest *gamRequest;
//3. Create a MesonGAMInterstitial object and Init with adUnitId and adSize
@property(nonatomic,strong) MesonGAMInterstitial *mesonInt;
self.mesonInt = [[MesonGAMInterstitial alloc] initWithAdUnitId: #adUnitId];
Initialize the SKStoreManager as follows:
//Please import the MesonWrapSKAN for CocoaPods integration. For manual please import the files.
var mesonInterstitialSKStoreManager: MesonInterstitialSKStoreManager()
//Please import the MesonWrapSKAN for CocoaPods integration. For manual please import the files.
@property(nonatomic,strong) MesonInterstitialSKStoreManager *mesonInterstitialSKStoreManager;
self.mesonInterstitialSKStoreManager = [[MesonInterstitialSKStoreManager alloc] init];
To implement a delegate for GAM follow:
//Success or failure callbacks
extension <ClassName>: MesonGAMBidFetcherDelegate {
func bidFetched(for ppmAd: GAMRequest) {
// Create a GAMInterstitialAd and call load with GAMRequest
}
func bidFailed(for ppmAd: GAMRequest, with error: Error) {
// Create a GAMInterstitialAd and call load with GAMRequest
}
}
@interface <ClassName> () <MesonGAMBidFetcherDelegate> {
//Success or failure callbacks
- (void)bidFetchedFor:(GAMRequest *)ppmAd {
// Create a GAMInterstitialAd and call load with GAMRequest
}
- (void)bidFailedFor:(GAMRequest *)ppmAd error:(NSError *)error {
// Create a GAMInterstitialAd and call load with GAMRequest
}
}
To fetch a bid for GAM follows:
// Fetch the Bid using the MesonGAMInterstitial.fetchBid with delegate MesonGAMBidFetcherDelegate.
mesonInt?.fetchBid(gamRequest: gamRequest, delegate: self)
// Fetch the Bid using the MesonGAMInterstitial fetchBid with delegate MesonGAMBidFetcherDelegate.
[self.mesonInt fetchBidWithGamRequest:self.gamRequest delegate:self];
After successfully loading the Interstitial Ad, call the following from the load success callback of MoPub / GAM Delegate:
self.mesonInterstitialSKStoreManager.start(delegate: self)
[self.mesonInterstitialSKStoreManager startWithDelegate:self];
Implement the following delegate methods
extension <ClassName>: MesonSkStoreManagerDelegate {
func didFailToLoad(error: Error) {
// SKStore fails to load
}
func didFailToShow(error: Error) {
// SKStore fails to show
}
func didShow(skStore: UIViewController) {
// SKStore successfully shown with the view controller
}
func willDismiss(skStore: UIViewController) {
// Successfully closed the SKStore view controller
}
}
@interface <ClassName> () <MesonSkStoreManagerDelegate> {
- (void)didFailToLoadWithError:(NSError * _Nonnull)error {
// SKStore fails to load
}
- (void)didFailToShowWithError:(NSError * _Nonnull)error {
// SKStore fails to show
}
- (void)didShowWithSkStore:(UIViewController * _Nonnull)skStore {
// SKStore successfully shown with the view controller
}
- (void)willDismissWithSkStore:(UIViewController * _Nonnull)skStore {
// Successfully closed the SKStore view controller
}
}
Next, Manage Demand and Configure your Ad Server.