-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file using the standards as defined at [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0). | ||
|
||
### Version 5.0.0 *(2024-08-08)* | ||
|
||
First version of the Chartboost Mediation Unity SDK - Google Bidding Adapter. | ||
|
||
#Added | ||
- Support for the following `Google Bidding` dependencies. Notice adapter dependencies are optimistic and any patches and hot-fixes will be automatically picked up.: | ||
* Android: `com.chartboost:chartboost-mediation-adapter-google-bidding:5.23.2.+` | ||
* iOS: `ChartboostMediationAdapterGoogleBidding ~> 5.11.5.0` | ||
|
||
- `GoogleBiddingAdapter.cs` with Configuration Properties for `Google Bidding`. | ||
- The following properties have been added in `GoogleBiddingAdapter.cs` | ||
* `string AdapterUnityVersion` | ||
* `string AdapterNativeVersion` | ||
* `string PartnerSDKVersion` | ||
* `string PartnerIdentifier` | ||
* `string PartnerDisplayName` | ||
* `IReadOnlyCollection<string> TestDeviceIds` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package> | ||
<metadata> | ||
<id>Chartboost.CSharp.Mediation.Unity.Adapter.GoogleBidding</id> | ||
<version>5.0.0</version> | ||
<title>Chartboost Mediation Adapter - Google Bidding</title> | ||
<description>The Chartboost Mediation Unity SDK Adapter for Google Bidding.</description> | ||
<authors>Chartboost</authors> | ||
<owners>Chartboost</owners> | ||
<license type="file">LICENSE.md</license> | ||
<readme>README.md</readme> | ||
<projectUrl>https://www.chartboost.com/products/mediation/</projectUrl> | ||
<copyright>Copyright 2024</copyright> | ||
<tags>Chartboost, Ads, Mediation, Unity, Adapter, Google Bidding, cs</tags> | ||
<repository type="git" url="https://github.com/ChartBoost/chartboost-mediation-unity-adapter-google-bidding.git"/> | ||
<dependencies> | ||
<dependency id="Chartboost.CSharp.Mediation.Unity" version="5.0.0" /> | ||
<dependency id="Chartboost.CSharp.Threading.Unity" version="1.0.1" /> | ||
<dependency id="Chartboost.CSharp.Utilities.Unity" version="1.0.1" /> | ||
<dependency id="Chartboost.CSharp.Logging.Unity" version="1.0.0" /> | ||
<dependency id="Chartboost.CSharp.Utilities.Google.Unity" version="1.0.0" /> | ||
</dependencies> | ||
</metadata> | ||
</package> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<dependencies> | ||
<androidPackages> | ||
<!-- Android Adapter --> | ||
<androidPackage spec="com.chartboost:chartboost-mediation-adapter-google-bidding:5.23.2.+"/> | ||
</androidPackages> | ||
<iosPods> | ||
<!-- iOS Adapter --> | ||
<iosPod name="ChartboostMediationAdapterGoogleBidding" version="~> 5.11.5.0"/> | ||
|
||
<!-- Partner iOS SDK--> | ||
<iosPod name="Google-Mobile-Ads-SDK" version="~> 11.5.0" addToAllTargets="false"/> | ||
</iosPods> | ||
</dependencies> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
MIT License | ||
|
||
Copyright 2024 Chartboost Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,92 @@ | ||
# chartboost-mediation-unity-adapter-google-bidding | ||
# Chartboost Mediation Unity SDK - Google Bidding 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.google-bidding/Editor/GoogleBiddingAdapterDependencies.xml`. | ||
|
||
# Installation | ||
|
||
## Using the public [npm registry](https://www.npmjs.com/search?q=com.chartboost.mediation.unity.adapter.google-bidding) | ||
|
||
In order to add the Chartboost Mediation Unity SDK - Google Bidding 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. | ||
|
||
```json | ||
"dependencies": { | ||
"com.chartboost.mediation.unity.adapter.google-bidding": "5.0.0", | ||
... | ||
}, | ||
"scopedRegistries": [ | ||
{ | ||
"name": "NpmJS", | ||
"url": "https://registry.npmjs.org", | ||
"scopes": [ | ||
"com.chartboost" | ||
] | ||
} | ||
] | ||
``` | ||
## Using the public [NuGet package](https://www.nuget.org/packages/Chartboost.CSharp.Mediation.Unity.Adapter.GoogleBidding) | ||
|
||
To add the Chartboost Mediation Unity SDK - Google Bidding Adapter to your project using the NuGet package, you will first need to add the [NugetForUnity](https://github.com/GlitchEnzo/NuGetForUnity) package into your Unity Project. | ||
|
||
This can be done by adding the following to your Unity Project's ***manifest.json*** | ||
|
||
```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.GoogleBidding` in the search bar of Nuget Explorer window(Nuget -> Manage Nuget Packages). | ||
You should be able to see the `Chartboost.CSharp.Mediation.Unity.Adapter.GoogleBidding` package. Choose the appropriate version and install. | ||
|
||
# Chartboost - Google Utilities for AndroidManifest.xml & Info.plist | ||
In order for the Google User Messaging Platform to initialize the `application ID` must be added to the `AndroidManifest.xml` & `Info.plist`. Chartboost provides this functionality through its dependency package for Google adapters. | ||
|
||
Simply click on the Editor menu: `Chartboost/Google/Configure` and set your `application ID` as needed. This configuration is shared for all Google packages possibly integrated, e.g: Google User Messaging Platform, AdMob, Google Bidding, etc. | ||
|
||
# Usage | ||
|
||
The following code block exemplifies usage of the `GoogleBiddingAdapter.cs` configuration class. | ||
|
||
## IPartnerAdapterConfiguration Properties | ||
|
||
```csharp | ||
|
||
// AdapterUnityVersion - The partner adapter Unity version, e.g: 5.0.0 | ||
Debug.Log($"Adapter Unity Version: {GoogleBiddingAdapter.AdapterUnityVersion}"); | ||
|
||
// AdapterNativeVersion - The partner adapter version, e.g: 5.22.3.0.0 | ||
Debug.Log($"Adapter Native Version: {GoogleBiddingAdapter.AdapterNativeVersion}"); | ||
|
||
// PartnerSDKVersion - The partner SDK version, e.g: 22.3.0 | ||
Debug.Log($"Partner SDK Version: {GoogleBiddingAdapter.PartnerSDKVersion}"); | ||
|
||
// PartnerIdentifier - The partner ID for internal uses, e.g: google_googlebidding | ||
Debug.Log($"Partner Identifier: {GoogleBiddingAdapter.PartnerIdentifier}"); | ||
|
||
// PartnerDisplayName - The partner name for external uses, e.g: Google Bidding | ||
Debug.Log($"Partner Display Name: {GoogleBiddingAdapter.PartnerDisplayName}"); | ||
``` | ||
|
||
## Test Device Ids | ||
|
||
Test device Ids can be set and fetch using `GoogleBiddingAdapter.TestDeviceIds`. | ||
|
||
```csharp | ||
|
||
// Example test device ids | ||
var testDeviceIds = new List<string> | ||
{ | ||
"33BE2250B43518CCDA7DE426D04EE231", | ||
"33BE2250B43518CCDA7DE426D04EE232", | ||
"33BE2250B43518CCDA7DE426D04EE233" | ||
}; | ||
|
||
// Setting test device ids | ||
GoogleBiddingAdapter.TestDeviceIds = testDeviceIds; | ||
|
||
// Clearing test device ids | ||
GoogleBiddingAdapter.TestDeviceIds = null; | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using UnityEngine.Scripting; | ||
|
||
[assembly: AlwaysLinkAssembly] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "Chartboost.Mediation.GoogleBidding.Android", | ||
"rootNamespace": "Chartboost.Mediation.GoogleBidding.Android", | ||
"references": [ | ||
"Chartboost.Threading", | ||
"Chartboost.Logging", | ||
"Chartboost.Mediation.GoogleBidding", | ||
"Chartboost.Mediation", | ||
"Chartboost.Mediation.Android", | ||
"Chartboost.Utilities.Android" | ||
], | ||
"includePlatforms": [ | ||
"Android", | ||
"Editor" | ||
], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [ | ||
"" | ||
], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System.Collections.Generic; | ||
using Chartboost.Constants; | ||
using Chartboost.Mediation.GoogleBidding.Common; | ||
using UnityEngine; | ||
|
||
namespace Chartboost.Mediation.GoogleBidding.Android | ||
{ | ||
internal sealed class GoogleBiddingAdapter : IGoogleBiddingAdapter | ||
{ | ||
private const string GoogleBiddingAdapterConfiguration = "com.chartboost.mediation.googlebiddingadapter.GoogleBiddingAdapterConfiguration"; | ||
|
||
[RuntimeInitializeOnLoadMethod] | ||
private static void RegisterInstance() | ||
{ | ||
if (Application.isEditor) | ||
return; | ||
GoogleBidding.GoogleBiddingAdapter.Instance = new GoogleBiddingAdapter(); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public string AdapterNativeVersion | ||
{ | ||
get | ||
{ | ||
using var adapterConfiguration = new AndroidJavaObject(GoogleBiddingAdapterConfiguration); | ||
return adapterConfiguration.Call<string>(SharedAndroidConstants.FunctionGetAdapterVersion); | ||
} | ||
} | ||
|
||
/// <inheritdoc/> | ||
public string PartnerSDKVersion | ||
{ | ||
get | ||
{ | ||
using var adapterConfiguration = new AndroidJavaObject(GoogleBiddingAdapterConfiguration); | ||
return adapterConfiguration.Call<string>(SharedAndroidConstants.FunctionGetPartnerSdkVersion); | ||
} | ||
} | ||
|
||
/// <inheritdoc/> | ||
public string PartnerIdentifier | ||
{ | ||
get | ||
{ | ||
using var adapterConfiguration = new AndroidJavaObject(GoogleBiddingAdapterConfiguration); | ||
return adapterConfiguration.Call<string>(SharedAndroidConstants.FunctionGetPartnerId); | ||
} | ||
} | ||
|
||
/// <inheritdoc/> | ||
public string PartnerDisplayName | ||
{ | ||
get | ||
{ | ||
using var adapterConfiguration = new AndroidJavaObject(GoogleBiddingAdapterConfiguration); | ||
return adapterConfiguration.Call<string>(SharedAndroidConstants.FunctionGetPartnerDisplayName); | ||
} | ||
} | ||
|
||
/// <inheritdoc/> | ||
public IReadOnlyCollection<string> TestDeviceIds { | ||
get | ||
{ | ||
using var adapterConfiguration = new AndroidJavaObject(GoogleBiddingAdapterConfiguration); | ||
using var nativeTestDeviceIds = adapterConfiguration.Call<AndroidJavaObject>(SharedAndroidConstants.FunctionGetTestDeviceIds); | ||
return nativeTestDeviceIds.NativeListToList(); | ||
} | ||
set | ||
{ | ||
using var adapterConfiguration = new AndroidJavaObject(GoogleBiddingAdapterConfiguration); | ||
using var nativeList = value.EnumerableToNativeList(); | ||
adapterConfiguration.Call(SharedAndroidConstants.FunctionSetTestDeviceIds, nativeList); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Runtime.CompilerServices; | ||
using Chartboost.Mediation.GoogleBidding; | ||
using UnityEngine.Scripting; | ||
|
||
[assembly: AlwaysLinkAssembly] | ||
[assembly: InternalsVisibleTo(AssemblyInfo.GoogleBiddingAssemblyInfoAndroid)] | ||
[assembly: InternalsVisibleTo(AssemblyInfo.GoogleBiddingAssemblyInfoIOS)] | ||
|
||
namespace Chartboost.Mediation.GoogleBidding | ||
{ | ||
internal class AssemblyInfo | ||
{ | ||
public const string GoogleBiddingAssemblyInfoAndroid = "Chartboost.Mediation.GoogleBidding.Android"; | ||
public const string GoogleBiddingAssemblyInfoIOS = "Chartboost.Mediation.GoogleBidding.IOS"; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.