Skip to content

Adding a Custom Adapter

To add a custom adapter to your Unity project for XMediator, follow these steps:

  1. Create a new XML file using the template below:

    <dependencies>
      <details>
        <name>CustomAdapter</name>
        <version>1.0.0</version>
        <description>Custom adapter for MediationName</description>
        <installedAt>63780175598331</installedAt>
        <androidVersion>1.0.0.0</androidVersion>
        <iOSVersion>1.0.0.0</iOSVersion>
      </details>
      <androidPackages>
        <androidPackage spec="com.custom.package:custom-adapter:1.0.0.0"/>
        <repositories>
          <repository>https://custom.repository.com/maven</repository>
        </repositories>
      </androidPackages>
      <iosPods>
        <iosPod name="CustomAdapter" version="1.0.0.0"/>
        <sources>
          <source>https://github.com/customproject/podspecs.git</source>
          <source>https://cdn.cocoapods.org/</source>
        </sources>
      </iosPods>
    </dependencies>
    
  2. Save the file as CustomAdapterDependencies.xml (or a name that makes sense for your custom adapter) and place it in the Assets/XMediatorSettings/Editor/ directory of your Unity project.

  3. Resolve the dependencies in Unity by following these steps:

    1. Go to the Unity menu
    2. Navigate to Assets → External Dependency Manager → Android Resolver → Resolve

This process should set up the custom adapters for both Android and iOS platforms in your Unity project.

Note

Make sure to replace the placeholder values in the XML template with the actual details of your custom adapter.

Tip

If you encounter any issues during the integration process, consult the documentation of your custom adapter or reach out to the adapter provider for support.