Skip to content

Commit

Permalink
Merge pull request #107 in MOBILE-SDK/app_mobile-sdk-ios from Mediate…
Browse files Browse the repository at this point in the history
…dViews_Stub_modifications to master

* commit 'c4535952268dab75d6537c0a5f034cdaf893f9b5':
  modify stubs to make the ad units work
  changed the mediation stub request
  • Loading branch information
ppuviarasu committed Mar 15, 2017
2 parents f59b611 + c453595 commit e3859a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion sdk/internal/ANGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define AN_ERROR_TABLE @"errors"

#define AN_DEFAULT_PLACEMENT_ID @"default_placement_id"
#define AN_SDK_VERSION @"3.0"
#define AN_SDK_VERSION @"3.1"

#define APPNEXUS_BANNER_SIZE CGSizeMake(320, 50)
#define APPNEXUS_MEDIUM_RECT_SIZE CGSizeMake(300, 250)
Expand Down
35 changes: 12 additions & 23 deletions tests/MediationAdapterApp/ANMediationAdapterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ + (NSArray *)networks {
@"FacebookNative",
@"MoPubBanner",
@"MoPubInterstitial",
@"MoPubNative",
@"AmazonBanner",
@"AmazonInterstitial",
@"MillennialMediaBanner",
Expand Down Expand Up @@ -146,7 +145,7 @@ - (void)stubRubiconBanner {
ANMediatedAd *mediatedAd = [[ANMediatedAd alloc] init];
[ANAdAdapterBaseRubicon setRubiconPublisherID:@"111008"];
mediatedAd.className = @"ANAdAdapterBannerRubicon";
mediatedAd.adId = @"{\\\"app_id\\\":\\\"01573C50497A0130031B123139244773\\\",\\\"pub_id\\\":\\\"111008\\\",\\\"base_url\\\":\\\"https://mrp.rubiconproject.com/\\\"}";
mediatedAd.adId = @"{\\\"adId\\\":\\\"01573C50497A0130031B123139244773\\\",\\\"pubId\\\":\\\"111008\\\",\\\"serverName\\\":\\\"https://mrp.rubiconproject.com/\\\"}";
mediatedAd.width = @"320";
mediatedAd.height = @"50";
[self stubMediatedAd:mediatedAd];
Expand Down Expand Up @@ -218,7 +217,7 @@ -(ANBannerAdView *) loadSmartAdBannerWithDelegate:(id<ANBannerAdViewDelegate>)de
- (void)stubSmartAdBanner {
ANMediatedAd *mediatedAd = [[ANMediatedAd alloc] init];
mediatedAd.className = @"ANAdAdapterBannerSmartAd";
mediatedAd.adId = @"{\\\"siteId\\\":\\\"104808\\\",\\\"pageId\\\":\\\"663262\\\",\\\"formatId\\\":\\\"15140\\\"}";
mediatedAd.adId = @"{\\\"site_id\\\":\\\"104808\\\",\\\"page_id\\\":\\\"663262\\\",\\\"format_id\\\":\\\"15140\\\"}";

mediatedAd.width = @"320";
mediatedAd.height = @"50";
Expand All @@ -233,7 +232,7 @@ - (ANInterstitialAd *)loadSmartAdInterstitialWithDelegate:(id<ANInterstitialAdDe
- (void)stubSmartAdInterstitial {
ANMediatedAd *mediatedAd = [[ANMediatedAd alloc] init];
mediatedAd.className = @"ANAdAdapterInterstitialSmartAd";
mediatedAd.adId = @"{\\\"siteId\\\":\\\"54522\\\",\\\"pageId\\\":\\\"401554\\\",\\\"formatId\\\":\\\"14514\\\"}";
mediatedAd.adId = @"{\\\"site_id\\\":\\\"54522\\\",\\\"page_id\\\":\\\"401554\\\",\\\"format_id\\\":\\\"14514\\\"}";
[self stubMediatedAd:mediatedAd];
}

Expand Down Expand Up @@ -348,21 +347,6 @@ - (void)stubMoPubInterstitial {
[self stubMediatedAd:mediatedAd];
}

- (ANNativeAdRequest *)loadMoPubNativeWithDelegate:(id<ANNativeAdRequestDelegate>)delegate {
[self stubMoPubNative];
ANNativeAdRequest *nativeAdRequest = [self nativeAdRequestWithDelegate:delegate];
nativeAdRequest.shouldLoadIconImage = YES;
nativeAdRequest.shouldLoadMainImage = YES;
return nativeAdRequest;
}

- (void)stubMoPubNative {
ANMediatedAd *mediatedAd = [[ANMediatedAd alloc] init];
mediatedAd.className = @"ANAdAdapterNativeMoPub";
mediatedAd.adId = @"2e1dc30d43c34a888d91b5203560bbf6";
[self stubMediatedAd:mediatedAd];
}

#pragma mark - Millennial Media

- (ANBannerAdView *)loadMillennialMediaBannerWithDelegate:(id<ANBannerAdViewDelegate>)delegate {
Expand Down Expand Up @@ -477,7 +461,7 @@ - (void)stubDFPSmartBanner {
- (void)stubDFPInterstitial {
ANMediatedAd *mediatedAd = [[ANMediatedAd alloc] init];
mediatedAd.className = @"ANAdAdapterInterstitialDFP";
mediatedAd.adId = @"/19968336/MediationAdapterAppTest";
mediatedAd.adId = @"/6499/example/interstitial";
[self stubMediatedAd:mediatedAd];
}

Expand Down Expand Up @@ -620,6 +604,11 @@ - (void)stubVdopiaInterstitial {

#pragma mark - AdColony

/************
AdColony Native & Interstital cannot be tested at the same instance of the app because of single instance initialization of configuring the appID/Zone Id
So close the app & test the next ad type
*************/

- (ANInterstitialAd *)loadAdColonyInterstitialWithDelegate:(id<ANInterstitialAdDelegate>)delegate {
[self stubAdColonyInterstitial];
static dispatch_once_t startToken;
Expand All @@ -641,8 +630,8 @@ - (ANNativeAdRequest *)loadAdColonyNativeWithDelegate:(id<ANNativeAdRequestDeleg
[self stubAdColonyNative];
static dispatch_once_t startToken;
dispatch_once(&startToken, ^{
[ANAdAdapterBaseAdColony configureWithAppID:@"app553a8f6740d84f3ba0"
zoneIDs:@[@"vzee73d915bab747ee8a"]];
[ANAdAdapterBaseAdColony configureWithAppID:@"app2086517932ad4b608a"
zoneIDs:@[@"vz7c0765ee52af4d67b9"]];
});
ANNativeAdRequest *nativeAdRequest = [self nativeAdRequestWithDelegate:delegate];
nativeAdRequest.shouldLoadIconImage = YES;
Expand All @@ -653,7 +642,7 @@ - (ANNativeAdRequest *)loadAdColonyNativeWithDelegate:(id<ANNativeAdRequestDeleg
- (void)stubAdColonyNative {
ANMediatedAd *mediatedAd = [[ANMediatedAd alloc] init];
mediatedAd.className = @"ANAdAdapterNativeAdColony";
mediatedAd.adId = @"vzee73d915bab747ee8a";
mediatedAd.adId = @"vz7c0765ee52af4d67b9";
[self stubMediatedAd:mediatedAd];
}

Expand Down

0 comments on commit e3859a9

Please sign in to comment.