Skip to content

Commit

Permalink
Syncing changes from private repository
Browse files Browse the repository at this point in the history
  • Loading branch information
helium-service committed Aug 8, 2024
1 parent 20d132f commit 1caa573
Show file tree
Hide file tree
Showing 56 changed files with 960 additions and 1 deletion.
20 changes: 20 additions & 0 deletions CHANGELOG.md
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`
7 changes: 7 additions & 0 deletions CHANGELOG.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Chartboost.CSharp.Mediation.Unity.Adapter.GoogleBidding.nuspec
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.

8 changes: 8 additions & 0 deletions Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Editor/GoogleBiddingAdapterDependencies.xml
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>
7 changes: 7 additions & 0 deletions Editor/GoogleBiddingAdapterDependencies.xml.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions LICENSE.md
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.
7 changes: 7 additions & 0 deletions LICENSE.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 92 additions & 1 deletion README.md
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;
```
7 changes: 7 additions & 0 deletions README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Runtime/Android.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Runtime/Android/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using UnityEngine.Scripting;

[assembly: AlwaysLinkAssembly]
3 changes: 3 additions & 0 deletions Runtime/Android/AssemblyInfo.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions Runtime/Android/Chartboost.Mediation.GoogleBidding.Android.asmdef
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.

76 changes: 76 additions & 0 deletions Runtime/Android/GoogleBiddingAdapter.cs
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);
}
}
}
}
11 changes: 11 additions & 0 deletions Runtime/Android/GoogleBiddingAdapter.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Runtime/GoogleBidding.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Runtime/GoogleBidding/AssemblyInfo.cs
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";
}
}
3 changes: 3 additions & 0 deletions Runtime/GoogleBidding/AssemblyInfo.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1caa573

Please sign in to comment.