{"id":25936843,"url":"https://github.com/chartboost/chartboost-mediation-ios-adapter-reference","last_synced_at":"2026-02-10T03:31:13.932Z","repository":{"id":78182579,"uuid":"503861914","full_name":"ChartBoost/chartboost-mediation-ios-adapter-reference","owner":"ChartBoost","description":"Helium iOS SDK Reference adapter","archived":false,"fork":false,"pushed_at":"2024-09-17T15:07:45.000Z","size":149,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-22T17:59:29.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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":"CONTRIBUTING.md","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}},"created_at":"2022-06-15T17:28:51.000Z","updated_at":"2024-08-01T21:57:18.000Z","dependencies_parsed_at":"2023-07-11T06:46:07.768Z","dependency_job_id":"2e1c6950-0173-4eea-a275-8a99ca0f70d6","html_url":"https://github.com/ChartBoost/chartboost-mediation-ios-adapter-reference","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ChartBoost/chartboost-mediation-ios-adapter-reference","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-ios-adapter-reference","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-ios-adapter-reference/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-ios-adapter-reference/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-ios-adapter-reference/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChartBoost","download_url":"https://codeload.github.com/ChartBoost/chartboost-mediation-ios-adapter-reference/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fchartboost-mediation-ios-adapter-reference/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271121168,"owners_count":24702723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-03-04T02:54:52.141Z","updated_at":"2026-02-10T03:31:13.851Z","avatar_url":"https://github.com/ChartBoost.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chartboost Mediation Reference Adapter\n\nThe Chartboost Mediation Reference adapter showcases the integration with the API of the Chartboost Mediation SDK, for reference and testing purposes only.\n\n## Minimum Requirements\n\n| Plugin | Version |\n| ------ | ------ |\n| Chartboost Mediation SDK | 5.0.0+ |\n| Cocoapods | 1.11.3+ |\n| iOS | 13.0+ |\n| Xcode | 15.0+ |\n\n## Integration\n\nIn your `Podfile`, add the following entry:\n```\npod 'ChartboostMediationAdapterReference'\n```\n\n## Chartboost Mediation Custom Adapter Implementation Guide\n\n\u003e [!IMPORTANT]\n\u003e Chartboost Mediation does not provide official support for custom adapters. For a list of official adapters, [visit this site](https://adapters.chartboost.com).\n\n1. Create a new class that conforms to Chartboost Mediation's `PartnerAdapter` protocol.\n2. Implement `var partnerSDKVersion: String { get }` to return the version number of the partner SDK. Most adapters fetch this from the partner SDK's API so the adapter always reports the correct version even if the SDK version has changed.\n3. Implement `var adapterVersion: String { get }` to return the version number of the Mediation adapter. The adapter version format is `\u003cChartboost Mediation major version\u003e.\u003cPartner major version\u003e.\u003cPartner minor version\u003e.\u003cPartner patch version\u003e.\u003cPartner build version\u003e.\u003cAdapter build version\u003e`.  \n`\u003cPartner build version\u003e` is optional, and omitted by most partners.\nFor example, if this adapter is compatible with Chartboost Mediation SDK 4.x and partner SDK 1.2.3.[4], and this is its initial release, then `adapterVersion` is 4.1.2.3.[4].0.\n4. Implement `var partnerID: String { get }` with the internal identifier that the Chartboost Mediation SDK can use to refer to the current partner. Must match the value used on the Chartboost Mediation dashboard.\n5. Implement `var partnerDisplayName: String { get }`, the human readable partner name.\n6. Implement `func setGDPR(applies: Bool?, status: GDPRConsentStatus)`,  \n`func setCCPA(hasGivenConsent: Bool, privacyString: String)`,  \nand `func setCOPPA(isChildDirected: Bool)`,  \nwhich receive privacy settings from Chartboost Mediation SDK and apply them to the partner SDK.  \nThey are always called at startup when Chartboost Mediation initializes adapters. They will also be called any time the publisher updates privacy settings on the Mediation SDK.  \nNote that these privacy methods aren't called until *after* `setUp()`. If your SDK requires privacy settings to be passed in at init, you will need to set a safe default value at startup. In that case, consider saving the privacy settings to disk when you receive them so you can apply them at next startup.\nAny time you update your SDK's privacy settings, use `PartnerLogEvent.privacyUpdated(setting: String, value: Any?)` to log the change.\n7. Implement `init(storage: PartnerAdapterStorage)`. This is a no-op for most adapters, but if you need to prevent the same placement ID from being loaded twice then hold onto a reference to `storage`, which provides visibility into which ads from your network the Mediation SDK currently has loaded. See the implementation of `makeAd` in the reference adapter for an example of how to check this storage for duplicates.\n8. Implement `func setUp( with configuration: PartnerConfiguration, completion: @escaping (Error?) -\u003e Void )` to initialize the partner SDK and perform any necessary setup in order to request and serve ads. Call `PartnerLogEvent.setUpStarted()` before initializing your SDK. If the operation succeeds, log `PartnerLogEvent.setUpSucceded` and call `completion(nil)`. Otherwise, log `PartnerLogEvent.setUpFailed(Error)` and call `completion(Error)`.\nIf a call to this method times out, the Mediation SDK will consider your adapter un-initialized even if you later report a successful init.\n9. Implement `func fetchBidderInformation( request: PreBidRequest, completion: @escaping ([String: String]?) -\u003e Void )`. If you support bidding, return `completion([String: String])` of biddable token Strings. The keys used in this dictionary depend on how your network's bidder was integrated with our backend. Usually Chartboost just passes these labels through to the bidding server, so whatever your RTB spec says probably applies here i.e. if your server expects bidder information in a field called 'token', then 'token' would be used.  \nAs you fetch/generate the token(s), use these three `PartnerLogEvent`s to log execution:  \n`.fetchBidderInfoStarted(PreBidRequest)`  \n`.fetchBidderInfoSucceeded(PreBidRequest)`  \n`.fetchBidderInfoFailed(PreBidRequest, error: Error)`  \nIf bidding is not supported by your SDK, just call `completion(nil)`.\n10. Implement at least one class that wraps instances of your ads. It must conform to the `PartnerAd` protocol:  \n    - `var adapter: PartnerAdapter { get }`   \n    A reference to the adapter that created the ad.  \n    - `var request: PartnerAdLoadRequest { get }`  \n    The associated ad load request.  \n    - `var delegate: PartnerAdDelegate? { get }`  \n    The lifecycle events delegate.  \n    - `var inlineView: UIView? { get }`  \n    View for displaying banner ads. Not used for other ad types.  \n    - `func load(with viewController: UIViewController?, completion: @escaping (Error?) -\u003e Void)`  \n    Instantiate an ad from your network's SDK. If your SDK expects an ADM from a bid response to construct an ad, it will be in `request.adm`. For non-bidding ads, the placement ID will be available in `request.partnerPlacement`.\n    Call the completion after loading to indicate success or failure.  \n    - `func show(with viewController: UIViewController, completion: @escaping (Error?) -\u003e Void)`  \n    Show the loaded ad and then call the show completion closure. Never used on banner ads.  \n    - `func invalidate() throws`  \n    Called by the SDK before disposing of an ad. There's a no-op default implementation and most adapters don't implement their own because no special cleanup is necessary for their ads.  \n\n    Most adapters implement more than one ad type (i.e. [YourNetwork]BannerAd, [YourNetwork]InterstitialAd, etc). In that case, you can move some of the things required by `PartnerAd` into a parent class to reduce duplicated code. In this repo, you can see how `ReferenceAdapterAd` holds the `init` function and several properties that don't differ between subclasses.  \n    \n    Each `PartnerAd` also needs to store the `PartnerAdDelegate` that Chartboost Mediation SDK will pass to `makeAd`, and call the following delegate methods to report your ad lifecycle events:  \n    - `func didTrackImpression(_ ad: PartnerAd, details: PartnerDetails)`  \n    Call when the partner SDK registers an impression for the currently showing ad.  \n    - `func didClick(_ ad: PartnerAd, details: PartnerDetails)`  \n    Call when the partner ad has been clicked as the result of a user action.  \n    - `func didReward(_ ad: PartnerAd, details: PartnerDetails)`  \n    Call when a reward has been given for watching a video ad.  \n    - `func didDismiss(_ ad: PartnerAd, details: PartnerDetails, error: Error?)`  \n    Call when the partner ad has been dismissed as the result of a user action.  \n    - `func didExpire(_ ad: PartnerAd, details: PartnerDetails)`  \n    Call when the partner ad has expired as determined by the partner SDK.  \n11. Implement `func makeAd(request: PartnerAdLoadRequest, delegate: PartnerAdDelegate) throws -\u003e PartnerAd`, which returns your `PartnerAd`-conforming objects.\nIf you are writing an adapter for Chartboost Mediation 4.x, and your adapter supports Adaptive Banners or Rewarded Interstitials, you'll need to check for those within the `default` clause, to maintain backward compatibility.\n```swift\ndefault:\n    if request.format.rawValue == \"rewarded_interstitial\" {\n        return YourAdapterRewardedInterstitialAd(adapter: self, request: request, delegate: delegate)\n    } else if request.format.rawValue == \"adaptive_banner\" {\n        return YourAdapterAdapterBannerAd(adapter: self, request: request, delegate: delegate)\n    } else {\n        throw error(.loadFailureUnsupportedAdFormat)\n    }\n```\n12. On the Chartboost Mediation web dashboard, add your full adapter class name so your Mediation adapter and partner SDK can be initialized and interacted with for ad serving purposes.  \n\n13. If your SDK has configuration features that publishers need access to, make them available via a class called `[YourNetwork]AdapterConfiguration` that exposes public properties or methods.\n\n## Contributions\n\nWe are committed to a fully transparent development process and highly appreciate any contributions. Our team regularly monitors and investigates all submissions for the inclusion in our official adapter releases.\n\nRefer to our [CONTRIBUTING](https://github.com/ChartBoost/chartboost-mediation-ios-adapter-reference/blob/main/CONTRIBUTING.md) file for more information on how to contribute.\n\n## License\n\nRefer to our [LICENSE](https://github.com/ChartBoost/chartboost-mediation-ios-adapter-reference/blob/main/LICENSE.md) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchartboost%2Fchartboost-mediation-ios-adapter-reference","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchartboost%2Fchartboost-mediation-ios-adapter-reference","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchartboost%2Fchartboost-mediation-ios-adapter-reference/lists"}