{"id":25936800,"url":"https://github.com/chartboost/chartboost-mediation-unity-adapter-amazon-publisher-services","last_synced_at":"2026-01-28T20:25:31.882Z","repository":{"id":229735300,"uuid":"771757974","full_name":"ChartBoost/chartboost-mediation-unity-adapter-amazon-publisher-services","owner":"ChartBoost","description":"The Chartboost Mediation Unity SDK Ad Adapter for Amazon Publisher Services.","archived":false,"fork":false,"pushed_at":"2024-11-20T21:02:20.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-27T15:10:40.787Z","etag":null,"topics":["amazon","amazon-publisher-services","android","chartboost","chartboost-mediation","csharp","ios","mediation","unity"],"latest_commit_sha":null,"homepage":"https://www.chartboost.com/mediate","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChartBoost.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-13T22:31:33.000Z","updated_at":"2024-11-20T21:02:24.000Z","dependencies_parsed_at":"2024-11-15T00:28:46.443Z","dependency_job_id":"4f8ba4a6-b46e-48ad-8b65-b2920420a788","html_url":"https://github.com/ChartBoost/chartboost-mediation-unity-adapter-amazon-publisher-services","commit_stats":null,"previous_names":["chartboost/chartboost-mediation-unity-adapter-amazon-publisher-services"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ChartBoost/chartboost-mediation-unity-adapter-amazon-publisher-services","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-unity-adapter-amazon-publisher-services","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-unity-adapter-amazon-publisher-services/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-unity-adapter-amazon-publisher-services/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-unity-adapter-amazon-publisher-services/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChartBoost","download_url":"https://codeload.github.com/ChartBoost/chartboost-mediation-unity-adapter-amazon-publisher-services/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-unity-adapter-amazon-publisher-services/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28850748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","amazon-publisher-services","android","chartboost","chartboost-mediation","csharp","ios","mediation","unity"],"created_at":"2025-03-04T02:54:45.474Z","updated_at":"2026-01-28T20:25:31.875Z","avatar_url":"https://github.com/ChartBoost.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chartboost Mediation Unity SDK - Amazon Publisher Services Adapter\r\n\r\nProvides a list of externally configurable properties pertaining to the partner SDK that can be retrieved and set by publishers. \r\n\r\nDependencies for the adapter are now embedded in the package, and can be found at `com.chartboost.mediation.unity.adapter.amazon-publisher-services/Editor/AmazonPublisherServicesAdapterDependencies.xml`.\r\n\r\nAd adapter for Amazon Publisher Services, to be utilized along the APS Unity Plugin.\r\n\r\n# Installation\r\nThis package is meant to be integrating when using Amazon Publisher Services as an ad adapter.\r\n\r\n### Using the public [npm registry](https://www.npmjs.com/search?q=com.chartboost.mediation.unity.adapter.amazon-publisher-services)\r\n\r\nIn order to add the Chartboost Mediation Unity SDK - Amazon Publisher Services 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.\r\n\r\n```json\r\n\"dependencies\": {\r\n    \"com.chartboost.mediation.unity.adapter.amazon-publisher-services\": \"5.2.2\",\r\n    ...\r\n},\r\n\"scopedRegistries\": [\r\n{\r\n    \"name\": \"NpmJS\",\r\n    \"url\": \"https://registry.npmjs.org\",\r\n    \"scopes\": [\r\n    \"com.chartboost\"\r\n    ]\r\n}\r\n]\r\n```\r\n\r\n### Using the public [NuGet package](https://www.nuget.org/packages/Chartboost.CSharp.Mediation.Unity.Adapter.AmazonPublisherServices)\r\n\r\nTo add the Chartboost Mediation Unity SDK - Amazon Publisher Services 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.\r\n\r\nThis can be done by adding the following to your Unity Project's ***manifest.json***\r\n\r\n```json\r\n  \"dependencies\": {\r\n    \"com.github-glitchenzo.nugetforunity\": \"https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity\",\r\n    ...\r\n  },\r\n```\r\n\r\nOnce \u003ccode\u003eNugetForUnity\u003c/code\u003e is installed, search for `Chartboost.CSharp.Mediation.Unity.Adapter.AmazonPublisherServices` in the search bar of Nuget Explorer window(Nuget -\u003e Manage Nuget Packages).\r\nYou should be able to see the `Chartboost.CSharp.Mediation.Unity.Adapter.AmazonPublisherServices` package. Choose the appropriate version and install.\r\n\r\n# Demo App\r\nA demo application is available in the following [repository](https://github.com/ChartBoost/chartboost-mediation-unity-adapter-amazon-publisher-services-demo).\r\n\r\n# AndroidManifest.xml Permissions \u0026 Activities\r\n\r\nThe following permissions must be present in your manifest file:\r\n\r\n```xml\r\n\u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\r\n\u003cuses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" /\u003e\r\n\u003cuses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" /\u003e\r\n```\r\n\r\nIf you wish to pass geo location information, please include the following permissions in your manifest file:\r\n\r\n```xml\r\n\u003cuses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" /\u003e\r\n```\r\n\r\nAdd the following under the \u003capplication\u003e section of your manifest file:\r\n\r\n```xml\r\n\u003cactivity android:name=\"com.amazon.device.ads.DTBInterstitialActivity\"/\u003e\r\n\u003cactivity android:name=\"com.amazon.device.ads.DTBAdActivity\"/\u003e\r\n```\r\n\r\n# Dependencies\r\n\r\n\u003e **Note** \\\r\n\u003e We recommend to delete `Assets/Amazon/Scripts/Editor/AmazonDependencies.xml` and use the `AmazonPublisherServicesAdapterDependencies.xml` file included in the APS Adapter.\r\n\r\n## Using AmazonDependencies.xml and Adding AmazonPublisherServicesSDK to All Targets\r\n\r\nIn some scenarios your application might fail to load the `AmazonPublisherServicesSDK`, this is due to the default dependency included in the APS Unity plugin not adding the `AmazonPublisherServicesSDK` `addToAllTargets` flag.\r\n\r\nTo resolve, open, `Assets/Amazon/Scripts/Editor/AmazonDependencies.xml`\r\n\r\nAnd change: \r\n\r\n```xml\r\n\u003ciosPod name=\"AmazonPublisherServicesSDK\" version=\"~\u003e X.Y.Z\"/\u003e\r\n```\r\n\r\nto \r\n\r\n```xml\r\n\u003ciosPod name=\"AmazonPublisherServicesSDK\" version=\"~\u003e X.Y.Z\" addToAllTargets=\"true\"/\u003e\r\n```\r\n\r\n# Usage\r\n\r\n## IPartnerAdapterConfiguration Properties\r\n\r\n```csharp\r\n\r\n// AdapterUnityVersion - The partner adapter Unity version, e.g: 5.0.0\r\nDebug.Log($\"Adapter Unity Version: {AmazonPublisherServicesAdapter.AdapterUnityVersion}\");\r\n\r\n// AdapterNativeVersion - The partner adapter version, e.g: 5.9.9.5.0\r\nDebug.Log($\"Adapter Native Version: {AmazonPublisherServicesAdapter.AdapterNativeVersion}\");\r\n\r\n// PartnerSDKVersion - The partner SDK version, e.g: aps-android-9.9.5\r\nDebug.Log($\"Partner SDK Version: {AmazonPublisherServicesAdapter.PartnerSDKVersion}\");\r\n\r\n// PartnerIdentifier - The partner ID for internal uses, e.g: amazon_aps\r\nDebug.Log($\"Partner Identifier: {AmazonPublisherServicesAdapter.PartnerIdentifier}\");\r\n\r\n// PartnerDisplayName - The partner name for external uses, e.g: Amazon Publisher Services\r\nDebug.Log($\"Partner Display Name: {AmazonPublisherServicesAdapter.PartnerDisplayName}\");\r\n```\r\n## Test Mode\r\nTo enable test mode for the Amazon Publisher Services adapter, the following property has been made available:\r\n\r\n```csharp\r\nAmazonPublisherServicesAdapter.TestMode = true;\r\n```\r\n\r\n## Verbose Logging\r\nTo enable verbose logging for the Amazon Publisher Services adapter, the following property has been made available:\r\n\r\n```csharp\r\nAmazonPublisherServicesAdapter.VerboseLogging = true;\r\n```\r\n\r\n## Creating a Pre-Bidding Listener\r\n\r\nChartboost is not permitted to wrap the Amazon APS initialization or bid request methods directly. The adapter handles APS initialization and prebidding only when the managed prebidding flag is enabled. For more information please contact the Amazon APS support team at https://aps.amazon.com/aps/contact-us/.\r\n\r\nAs such, developers are meant to follow the guidelines in the [APS Unity Documentation](https://ams.amazon.com/webpublisher/uam/docs/aps-mobile/unity).\r\n\r\nIn order to pass prebidding information back to the Chartboost Mediation Unity SDK we have provided the following.\r\n\r\nDevelopers will have to call the APS Plugin and pass the information to the Chartboost Mediation SDK, the `PreBiddingListener` can be used to organize your logic and easily pass the required data, see example below:\r\n\r\n```csharp\r\npublic class CustomAmazonPublisherServicesPreBiddingListener : PreBiddingListener\r\n    {\r\n        private const string TAG = \"[APS PreBidding Listener]\";\r\n        \r\n        public override Task\u003cAmazonPublisherServicesAdapterPreBidAdInfo\u003e OnPreBid(AmazonPublisherServicesAdapterPreBidRequest request)\r\n        {\r\n            AdRequest adRequest = null;\r\n            var amazonSetting = request.AmazonSettings;\r\n            var width = amazonSetting.Width ?? 0;\r\n            var height = amazonSetting.Height ?? 0;\r\n            var amazonPlacement = amazonSetting.PartnerPlacement;\r\n                 \r\n            Debug.Log($\"{TAG} Format: {request.Format}, Chartboost Placement: {request.ChartboostPlacement}, Amazon Placement: {amazonPlacement}\");\r\n\r\n            switch (request.Format)\r\n            {\r\n                case \"rewarded\":\r\n                    adRequest = new APSVideoAdRequest(width, height, amazonPlacement);\r\n                    break;\r\n\r\n                case \"interstitial\":\r\n                case \"rewarded_interstitial\":\r\n                    adRequest = new APSInterstitialAdRequest(amazonPlacement);\r\n                    break;\r\n\r\n                case \"banner\":\r\n                case \"adaptive_banner\":\r\n                    adRequest = new APSBannerAdRequest(width, height, amazonPlacement);\r\n                    break;\r\n                \r\n                default:\r\n                    Debug.LogWarning($\"{TAG} Specified type is not valid, returning null values.\");\r\n                    return Task.FromResult(new AmazonPublisherServicesAdapterPreBidAdInfo(null, null));\r\n            }\r\n\r\n            var taskCompletionSource = new TaskCompletionSource\u003cAmazonPublisherServicesAdapterPreBidAdInfo\u003e();\r\n            \r\n            adRequest.onSuccess += response =\u003e\r\n            {\r\n                Debug.Log($\"{TAG} Response succeeded for: CBP: {request.ChartboostPlacement} - AMZP: {amazonPlacement}!\");\r\n                #if UNITY_IOS\r\n                taskCompletionSource.SetResult(new AmazonPublisherServicesAdapterPreBidAdInfo(response.GetPricePoint(), response.GetMediationHints()));\r\n                #elif UNITY_ANDROID\r\n                taskCompletionSource.SetResult(new AmazonPublisherServicesAdapterPreBidAdInfo(response.GetPricePoint(), response.GetBidInfo()));\r\n                #else\r\n                taskCompletionSource.SetResult(new AmazonPublisherServicesAdapterPreBidAdInfo(null, null));   \r\n                #endif\r\n            };\r\n\r\n            adRequest.onFailedWithError += error =\u003e\r\n            {\r\n                Debug.LogError($\"{TAG} Failed with Error: {error.GetMessage()} and Code: {error.GetCode()}\");\r\n                taskCompletionSource.SetResult(new AmazonPublisherServicesAdapterPreBidAdInfo(null, null));\r\n            };\r\n\r\n            adRequest.LoadAd();\r\n            return taskCompletionSource.Task;\r\n        }\r\n    }\r\n```\r\n\r\n### Setting the Pre-Bidding Listener\r\n\r\n```csharp\r\n// Publisher Initializes the AmazonPubliserServices Unity Plugin\r\nAmazon.Initialize(\"YOUR_AMAZON_API_KEY_GOES_HERE\");\r\n\r\n// Create instance for your Custom Pre-Bidding Listener\r\nAmazonPublisherServicesAdapter.PreBiddingListener = new CustomAmazonPublisherServicesPreBiddingListener();\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchartboost%2Fchartboost-mediation-unity-adapter-amazon-publisher-services","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchartboost%2Fchartboost-mediation-unity-adapter-amazon-publisher-services","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchartboost%2Fchartboost-mediation-unity-adapter-amazon-publisher-services/lists"}