Yandex Mobile Ads
Loading...
Searching...
No Matches
AdRequestCreator.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
4{
5 public class AdRequestCreator
6 {
7 private const string PluginTypeParameter = "plugin_type";
8 private const string PluginVersionParameter = "plugin_version";
9
10 private const string PluginType = "unity";
11
13 {
14 if (adRequest == null)
15 {
16 return null;
17 }
18
19 var parameters = adRequest.Parameters ?? new Dictionary<string, string>();
20 parameters.Add(PluginTypeParameter, PluginType);
21 parameters.Add(PluginVersionParameter, MobileAdsPackageInfo.PackageVersion);
22
23 return new AdRequest.Builder()
24 .WithAdRequest(adRequest)
25 .WithParameters(parameters)
26 .Build();
27 }
28 }
29}
A class responsible for creating AdRequest objects.
Definition AdRequest.cs:80
Builder WithParameters(Dictionary< string, string > parameters)
AdRequest Builder initialized with custom Parameters.
Definition AdRequest.cs:167
AdRequest Build()
Creates AdRequest based on current builder parameters.
Definition AdRequest.cs:197
Builder WithAdRequest(AdRequest adRequest)
AdRequest Builder initialized with AdRequest.
Definition AdRequest.cs:178
AdRequest CreateAdRequest(AdRequest adRequest)
Contains targeting information used to fetch an ad. new instance should be created using AdRequestCon...
Definition AdRequest.cs:20