Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/modulariz…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
yoalex5 committed Sep 10, 2019
2 parents 0d7579b + 5ce17db commit 71cb023
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 15 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/intentent-to-implement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Intentent to implement
about: Technical description and details of a new feature intending to implement.
Should be reviewed by PMC for approval.
title: ''
labels: Intent to Implement
assignees: ''

---

## Type of issue
<!-- Note if this is a documentation issue, please open a ticket here instead: https://github.com/prebid/prebid.github.io →
Intent to implement
## Description
<!-- Describe the issue -->

## Goals
<!--
If this is a bug, please provide a list of steps to reproduce the issue
-->

## Proposed Design
<!-- Technical details -->

### In-Scope

### Out of Scope
<!-- If any -->

### Prebid SDK Changes


### Prebid Server OpenRTB Changes
<!-- If any -->

### Prebid Server Changes
<!-- If any-->


## Other information
<!-- References to related issue or PR #s, etc. -->
76 changes: 63 additions & 13 deletions Example/PrebidDemo/PrebidDemoObjectiveC/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,32 @@ - (void)viewDidLoad {
// [[Prebid shared] setCustomPrebidServerWithUrl:@"" error:&err];
// if(err == nil)

if([self.adServer isEqualToString:@"DFP"] && [self.adUnit isEqualToString:@"Banner"])
[self loadDFPBanner];
if([self.adServer isEqualToString:@"DFP"] && [self.adUnit isEqualToString:@"Interstitial"])
[self loadDFPInterstitial];
if([self.adServer isEqualToString:@"MoPub"] && [self.adUnit isEqualToString:@"Banner"])
[self loadMoPubBanner];
if([self.adServer isEqualToString:@"MoPub"] && [self.adUnit isEqualToString:@"Interstitial"])
[self loadMoPubInterstitial];
self.bannerUnit = [[BannerAdUnit alloc] initWithConfigId:@"6ace8c7d-88c0-4623-8117-75bc3f0a2e45" size:CGSizeMake(300, 250)];
// self.interstitialUnit = [[InterstitialAdUnit alloc] initWithConfigId:@"625c6125-f19e-4d5b-95c5-55501526b2a4"];

// Advanced interstitial support
// self.interstitialUnit = [[InterstitialAdUnit alloc] initWithConfigId:@"625c6125-f19e-4d5b-95c5-55501526b2a4" minWidthPerc:50 minHeightPerc:70];

// [self enableCOPPA];
// [self addFirstPartyData:self.bannerUnit];
// [self setStoredResponse];
// [self setRequestTimeoutMillis];

if([self.adUnit isEqualToString:@"Banner"]) {

if ([self.adServer isEqualToString:@"DFP"]) {
[self loadDFPBanner];
} else if ([self.adServer isEqualToString:@"MoPub"]) {
[self loadMoPubBanner];
}
} else if ([self.adUnit isEqualToString:@"Interstitial"]) {

if ([self.adServer isEqualToString:@"DFP"]) {
[self loadDFPInterstitial];
} else if ([self.adServer isEqualToString:@"MoPub"]) {
[self loadMoPubInterstitial];
}
}
// Do any additional setup after loading the view, typically from a nib.
}

Expand All @@ -65,7 +81,6 @@ -(void) viewDidDisappear:(BOOL)animated{

-(void) loadDFPBanner {

self.bannerUnit = [[BannerAdUnit alloc] initWithConfigId:@"6ace8c7d-88c0-4623-8117-75bc3f0a2e45" size:CGSizeMake(300, 250)];
[self.bannerUnit setAutoRefreshMillisWithTime:35000];
self.dfpView = [[DFPBannerView alloc] initWithAdSize:kGADAdSizeMediumRectangle];
self.dfpView.rootViewController = self;
Expand All @@ -86,7 +101,6 @@ -(void) loadDFPBanner {

-(void) loadDFPInterstitial {

self.interstitialUnit = [[InterstitialAdUnit alloc] initWithConfigId:@"625c6125-f19e-4d5b-95c5-55501526b2a4"];
self.dfpInterstitial = [[DFPInterstitial alloc] initWithAdUnitID:@"/19968336/PrebidMobileValidator_Interstitial"];
self.dfpInterstitial.delegate = self;
self.request = [[DFPRequest alloc] init];
Expand All @@ -109,7 +123,6 @@ -(void) loadMoPubBanner {

[self.bannerView addSubview:self.mopubAdView];

self.bannerUnit = [[BannerAdUnit alloc] initWithConfigId:@"6ace8c7d-88c0-4623-8117-75bc3f0a2e45" size:CGSizeMake(300, 250)];
// Do any additional setup after loading the view, typically from a nib.
[self.bannerUnit fetchDemandWithAdObject:self.mopubAdView completion:^(enum ResultCode result) {
NSLog(@"Prebid demand result %ld", (long)result);
Expand All @@ -119,7 +132,6 @@ -(void) loadMoPubBanner {

-(void) loadMoPubInterstitial {

self.interstitialUnit = [[InterstitialAdUnit alloc] initWithConfigId:@"625c6125-f19e-4d5b-95c5-55501526b2a4"];
MPMoPubConfiguration *configuration = [[MPMoPubConfiguration alloc] initWithAdUnitIdForAppInitialization:@"2829868d308643edbec0795977f17437"];
[[MoPub sharedInstance] initializeSdkWithConfiguration:configuration completion:nil];
self.mopubInterstitial = [MPInterstitialAdController interstitialAdControllerForAdUnitId:@"2829868d308643edbec0795977f17437"];
Expand All @@ -131,7 +143,45 @@ -(void) loadMoPubInterstitial {


}


-(void) enableCOPPA {
Targeting.shared.subjectToCOPPA = true;
}

-(void) addFirstPartyData:(AdUnit *)adUnit {
//Access Control List
[Targeting.shared addBidderToAccessControlList: Prebid.bidderNameAppNexus];

//global user data
[Targeting.shared addUserDataWithKey:@"globalUserDataKey1" value:@"globalUserDataValue1"];

//global context data
[Targeting.shared addContextDataWithKey:@"globalContextDataKey1" value:@"globalContextDataValue1"];

//adunit context data
[adUnit addContextDataWithKey:@"adunitContextDataKey1" value:@"adunitContextDataValue1"];

//global context keywords
[Targeting.shared addContextKeyword:@"globalContextKeywordValue1"];
[Targeting.shared addContextKeyword:@"globalContextKeywordValue2"];

//global user keywords
[Targeting.shared addUserKeyword:@"globalUserKeywordValue1"];
[Targeting.shared addUserKeyword:@"globalUserKeywordValue2"];

//adunit context keywords
[adUnit addContextKeyword:@"adunitContextKeywordValue1"];
[adUnit addContextKeyword:@"adunitContextKeywordValue2"];
}

-(void) setStoredResponse {
Prebid.shared.storedAuctionResponse = @"111122223333";
}

-(void) setRequestTimeoutMillis {
Prebid.shared.timeoutMillis = 5000;
}

#pragma mark :- DFP delegates
-(void) adViewDidReceiveAd:(GADBannerView *)bannerView {
NSLog(@"Ad received");
Expand Down
43 changes: 43 additions & 0 deletions Example/PrebidDemo/PrebidDemoSwift/BannerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class BannerController: UIViewController, GADBannerViewDelegate, MPAdViewDelegat
bannerUnit = BannerAdUnit(configId: "6ace8c7d-88c0-4623-8117-75bc3f0a2e45", size: CGSize(width: 300, height: 250))
bannerUnit.setAutoRefreshMillis(time: 35000)
//bannerUnit.addAdditionalSize(sizes: [CGSize(width: 300, height: 600)])

// enableCOPPA()
// addFirstPartyData(adUnit: bannerUnit)
// setStoredResponse()
// setRequestTimeoutMillis()

if (adServerName == "DFP") {
print("entered \(adServerName) loop" )
Expand Down Expand Up @@ -105,6 +110,44 @@ class BannerController: UIViewController, GADBannerViewDelegate, MPAdViewDelegat
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

func enableCOPPA() {
Targeting.shared.subjectToCOPPA = true
}

func addFirstPartyData(adUnit: AdUnit) {
//Access Control List
Targeting.shared.addBidderToAccessControlList(Prebid.bidderNameAppNexus)

//global user data
Targeting.shared.addUserData(key: "globalUserDataKey1", value: "globalUserDataValue1")

//global context data
Targeting.shared.addContextData(key: "globalContextDataKey1", value: "globalContextDataValue1")

//adunit context data
adUnit.addContextData(key: "adunitContextDataKey1", value: "adunitContextDataValue1")

//global context keywords
Targeting.shared.addContextKeyword("globalContextKeywordValue1")
Targeting.shared.addContextKeyword("globalContextKeywordValue2")

//global user keywords
Targeting.shared.addUserKeyword("globalUserKeywordValue1")
Targeting.shared.addUserKeyword("globalUserKeywordValue2")

//adunit context keywords
adUnit.addContextKeyword("adunitContextKeywordValue1")
adUnit.addContextKeyword("adunitContextKeywordValue2")
}

func setStoredResponse() {
Prebid.shared.storedAuctionResponse = "111122223333"
}

func setRequestTimeoutMillis() {
Prebid.shared.timeoutMillis = 5000
}

func adViewDidReceiveAd(_ bannerView: GADBannerView) {
print("adViewDidReceiveAd")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class InterstitialViewController: UIViewController, GADInterstitialDelegate, MPI

Prebid.shared.prebidServerAccountId = "bfa84af2-bd16-4d35-96ad-31c6bb888df0"
let interstitialUnit = InterstitialAdUnit(configId: "625c6125-f19e-4d5b-95c5-55501526b2a4")

// Advanced interstitial support
// let interstitialUnit = InterstitialAdUnit(configId: "625c6125-f19e-4d5b-95c5-55501526b2a4", minWidthPerc: 50, minHeightPerc: 70)

if (adServerName == "DFP") {
print("entered \(adServerName) loop" )
Expand Down
2 changes: 1 addition & 1 deletion PrebidMobile.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "PrebidMobile"
s.version = "1.1.1"
s.version = "1.2"
s.summary = "PrebidMobile is a lightweight framework that integrates directly with Prebid Server."

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Source/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit 71cb023

Please sign in to comment.