Skip to content

Commit 464cb5f

Browse files
malandr2copybara-github
authored andcommitted
Added snippets for enabling test ads
PiperOrigin-RevId: 788570507
1 parent e2fb63b commit 464cb5f

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using UnityEngine;
2+
using GoogleMobileAds.Api;
3+
using System.Collections.Generic;
4+
5+
namespace GoogleMobileAds.Snippets
6+
{
7+
/// <summary>
8+
/// Code snippets used for the developer guides.
9+
/// </summary>
10+
internal class RequestConfigurationSnippets
11+
{
12+
// Replace with your own test device ID.
13+
private const string TEST_DEVICE_ID = "2077ef9a63d2b398840261c8221a0c9b";
14+
15+
private void SetTestDeviceIds()
16+
{
17+
// [START set_test_device_ids]
18+
List<string> testDeviceIds = new List<string>();
19+
testDeviceIds.Add(TEST_DEVICE_ID);
20+
21+
RequestConfiguration requestConfiguration = new RequestConfiguration
22+
{
23+
TestDeviceIds = testDeviceIds
24+
};
25+
// [END set_test_device_ids]
26+
27+
// [START set_request_configuration]
28+
MobileAds.SetRequestConfiguration(requestConfiguration);
29+
// [END set_request_configuration]
30+
}
31+
}
32+
}

samples/HelloWorld/Snippets/RequestConfigurationSnippets.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)