Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HB-6514 ] Include API to Allow Resizing of Gameobject Banner Based on Adaptive Banner Size #171

Merged
merged 31 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6fed491
resize API added
kushG Sep 13, 2023
e771f3a
removed #UNITY_ANDROID
kushG Sep 13, 2023
b04979b
WrapperStore added in iOS
kushG Sep 13, 2023
1d4a1fc
resize working on iOS
kushG Sep 14, 2023
ab70366
Merge branch 'HB-6379-helium-unity-include-adaptive-banner-support-in…
kushG Sep 14, 2023
b5e26b0
banner request container removed in iOS
kushG Sep 14, 2023
2c0def8
android WIP
kushG Sep 15, 2023
70d0c42
working logic for resize and drag on android
kushG Sep 16, 2023
8f13ca5
fix for horizontal and vertical alignment on android
kushG Sep 16, 2023
df39766
Merge remote-tracking branch 'origin/develop' into HB-6495-refactor-c…
kushG Sep 19, 2023
dae6308
Merge remote-tracking branch 'origin/develop' into HB-6495-refactor-c…
kushG Sep 19, 2023
ea7534a
size refactor
kushG Sep 19, 2023
ca9869d
ChartboostMediationBannerAdSize changed from class to struct
kushG Sep 20, 2023
f7084ae
ChartboostMediationBannerName renamed to ChartboostMediationBannerSiz…
kushG Sep 20, 2023
a765f26
Merge branch 'HB-6495-refactor-chartboost-mediation-ad-size-to-be-use…
kushG Sep 20, 2023
2f1b4d7
merge fixes
kushG Sep 20, 2023
bdbdeda
minor rename
kushG Sep 20, 2023
3e3809c
Merge branch 'HB-6495-refactor-chartboost-mediation-ad-size-to-be-use…
kushG Sep 20, 2023
a5a2904
working resize and drag on android
kushG Sep 21, 2023
9917b18
working ios code for resize and drag
kushG Sep 21, 2023
1d759a2
DiscardOversizedAds added
kushG Sep 21, 2023
de17e1a
removed debug code
kushG Sep 21, 2023
6d7f71d
Merge remote-tracking branch 'origin/develop' into adaptive-banner-re…
kushG Sep 21, 2023
42fec90
fixes for null/default values and removed some debug code
kushG Sep 21, 2023
4c09205
default state of banner drag set ot false
kushG Sep 21, 2023
cb16365
default state of resize set to "FitBoth"
kushG Sep 21, 2023
78f364e
missing EOL
kushG Sep 21, 2023
646ec37
autoLoadOnInit removed
kushG Sep 21, 2023
fa0c648
default set to AllNetworkBanner in demo
kushG Sep 21, 2023
a9614b5
renaming some enum options
kushG Sep 22, 2023
d31be26
disable test mode
kushG Sep 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion com.chartboost.mediation.demo/Assets/Demo/Demo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class Demo : MonoBehaviour
public Dropdown bannerLocationDropdown;
public Dropdown horizontalAlignmentDropdown;
public Dropdown verticalAlignmentDropdown;
public Dropdown resizeDropdown;

public ScrollRect outputTextScrollRect;
public Text outputText;
Expand Down Expand Up @@ -121,6 +122,7 @@ private void DidStart(string error)
ChartboostMediation.SetSubjectToGDPR(false);
ChartboostMediation.SetSubjectToCoppa(false);
ChartboostMediation.SetUserHasGivenConsent(true);
ChartboostMediation.SetTestMode(true);
kushG marked this conversation as resolved.
Show resolved Hide resolved
}

private void DidReceiveImpressionLevelRevenueData(string placement, Hashtable impressionData)
Expand Down Expand Up @@ -249,14 +251,19 @@ public async void OnCreateBannerClick()
_bannerAd.DidRecordImpression += DidRecordImpressionBanner;
_bannerAd.DidDrag += DidDragBanner;

// keywords
var keywords = _bannerAd.Keywords ??= new Dictionary<string, string>();
keywords.Add("bnr_keyword1", "bnr_value1");
keywords.Add("bnr_keyword2", "bnr_value2");
_bannerAd.Keywords = keywords;

// Alignment
_bannerAd.VerticalAlignment = (ChartboostMediationBannerVerticalAlignment)verticalAlignmentDropdown.value;
_bannerAd.HorizontalAlignment = (ChartboostMediationBannerHorizontalAlignment)horizontalAlignmentDropdown.value;


// Resize
_bannerAd.ResizeOption = (ResizeOption)resizeDropdown.value;

var result = await _bannerAd.Load();
Log(result.Error == null ? "Successfully loaded banner" : result.Error?.Message);
}
Expand All @@ -277,6 +284,14 @@ public void OnVerticalAlignmentChange()
}
}

public void OnResizeOptionChange()
{
if (_bannerAd != null)
{
_bannerAd.ResizeOption = (ResizeOption)resizeDropdown.value;
}
}

public void OnToggleBannerVisibilityClick()
{
if (_bannerAd != null)
Expand Down
Loading
Loading