Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine 5.0.1

dotnet add package Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine --version 5.0.1                
NuGet\Install-Package Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine -Version 5.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine" Version="5.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine --version 5.0.1                
#r "nuget: Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine, 5.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine as a Cake Addin
#addin nuget:?package=Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine&version=5.0.1

// Install Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine as a Cake Tool
#tool nuget:?package=Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine&version=5.0.1                

Chartboost Mediation Unity SDK - BidMachine Adapter

Provides a list of externally configurable properties pertaining to the partner SDK that can be retrieved and set by publishers.

Dependencies for the adapter are now embedded in the package, and can be found at com.chartboost.mediation.unity.adapter.bidmachine/Editor/BidMachineAdapterDependencies.xml.

Installation

Using the public npm registry

In order to add the Chartboost Mediation Unity SDK - BidMachine Adapter to your project using the npm package, add the following to your Unity Project's manifest.json file. The scoped registry section is required in order to fetch packages from the NpmJS registry.

"dependencies": {
    "com.chartboost.mediation.unity.adapter.bidmachine": "5.0.0",
    ...
},
"scopedRegistries": [
{
    "name": "NpmJS",
    "url": "https://registry.npmjs.org",
    "scopes": [
    "com.chartboost"
    ]
}
]

Using the public NuGet package

To add the Chartboost Mediation Unity SDK - BidMachine Adapter to your project using the NuGet package, you will first need to add the NugetForUnity package into your Unity Project.

This can be done by adding the following to your Unity Project's manifest.json

  "dependencies": {
    "com.github-glitchenzo.nugetforunity": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity",
    ...
  },

Once <code>NugetForUnity</code> is installed, search for Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine in the search bar of Nuget Explorer window(Nuget → Manage Nuget Packages). You should be able to see the Chartboost.CSharp.Mediation.Unity.Adapter.BidMachine package. Choose the appropriate version and install.

Network Cecurity Configuration

Android

Android 9.0 (API 28) blocks cleartext (non-HTTPS) traffic by default, which can prevent ads from being served correctly.

Warning
Failure to comply with this configuration may result in lower display rate, fill rate, rendering errors, and as a result - lower revenue.

Add a Network Security Configuration file to your AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest>
    <application android:networkSecurityConfig="@xml/network_security_config" />
</manifest>

In your network_security_config.xml file, add base-config that sets cleartextTrafficPermitted to true:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </base-config>
    <debug-overrides>
        <trust-anchors>
            <certificates src="user" />
        </trust-anchors>
    </debug-overrides>
</network-security-config>

iOS

Add this code to the Info.plist file:

<key>NSAppTransportSecurity</key>
  <dict>  
      <key>NSAllowsArbitraryLoads</key><true/>  
  </dict>
</dict>

Usage

The following code block exemplifies usage of the BidMachineAdapter.cs configuration class.

IPartnerAdapterConfiguration Properties


// AdapterUnityVersion - The partner adapter Unity version, e.g: 5.0.0
Debug.Log($"Adapter Unity Version: {BidMachineAdapter.AdapterUnityVersion}");

// AdapterNativeVersion - The partner adapter version, e.g: 5.2.6.0.0
Debug.Log($"Adapter Native Version: {BidMachineAdapter.AdapterNativeVersion}");

// PartnerSDKVersion - The partner SDK version, e.g: 2.6.0
Debug.Log($"Partner SDK Version: {BidMachineAdapter.PartnerSDKVersion}");

// PartnerIdentifier - The partner ID for internal uses, e.g: bidmachine
Debug.Log($"Partner Identifier: {BidMachineAdapter.PartnerIdentifier}");

// PartnerDisplayName - The partner name for external uses, e.g: BidMachine
Debug.Log($"Partner Display Name: {BidMachineAdapter.PartnerDisplayName}");

Test Mode

To enable test mode for the BidMachine adapter, the following property has been made available:

BidMachineAdapter.TestMode = true;

Verbose Logging

To enable verbose logging for the BidMachine adapter, the following property has been made available:

BidMachineAdapter.VerboseLogging = true;

Setting Targeting Parameters

To allow setting setting targeting parameters, the following method has been made available:

// This example sets BidMachine's targeting params utilizing sample values.
var targetingInfo = new TargetingParams();

targetingInfo.UserId = "TEST_USER_ID";
targetingInfo.Gender = Gender.MALE;
targetingInfo.YearOfBirth = 1990;
// Austin, TX
targetingInfo.Location = new Location(30.2672, 97.7431);
targetingInfo.Country = "United States";
targetingInfo.City = "Austin";
targetingInfo.Zip = "73301";
targetingInfo.Keywords = new[] { "whale", "mobile", "gaming" };
targetingInfo.BlockedApps = new[] { "com.test.id", "com.test.id2" };
// https://support.aerserv.com/hc/en-us/articles/207148516-List-of-IAB-Categories
targetingInfo.BlockedCategories = new[] { "IAB2", "IAB2-3" };
targetingInfo.BlockedAdvertisers = new[] { "tes.id.2", "test.id.1" };
targetingInfo.StoreUrl = "https://play.google.com/store/apps/details?id=com.android.chrome";
targetingInfo.StoreId = "com.android.chrome";
targetingInfo.StoreCategory = "Utilities";
targetingInfo.StoreSubCategories = new []{ "Internet", "Browser"};
targetingInfo.Paid = false;
targetingInfo.ExternalUserIds = new Dictionary<string, string>{ {"Meta", "META_USER_ID"}, {"PLAYFAB", "PLAYFAB_USER_ID"} };

BidMachineAdapter.SetTargetingParams(targetingInfo);

More information can be founds in BidMachine's Android and iOS documentation.

Setting Publisher Information

To allow setting publisher information, the following method has been made available:

// This example sets BidMachine's publisher info utilizing sample values.
const string publisherId = "chartboost";
const string publisherName = "Chartboost";
const string publisherDomain = "chartboost.com";
var categories = new[] { "ads", "games", "mobile" };

var publisherInfo = new PublisherInfo(publisherId, publisherName, publisherDomain, categories);

BidMachineAdapter.SetPublisherInfo(publisherInfo);
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.1 78 11/1/2024
5.0.0 114 8/8/2024