Skip to content

MET-5092: Prepare publisher facing API for Unity plugin - #97

Merged
antonurankar-moloco merged 64 commits into
developfrom
tomi-unity_api
Oct 21, 2025
Merged

MET-5092: Prepare publisher facing API for Unity plugin#97
antonurankar-moloco merged 64 commits into
developfrom
tomi-unity_api

Conversation

@antonurankar-moloco

@antonurankar-moloco antonurankar-moloco commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

Summary

Streamlines the Metica SDK initialization flow by separating core configuration from mediation setup, while adding GDPR/CCPA privacy controls for better compliance.

What's Changed

🔄 Initialization API Redesign

  • Split monolithic MeticaConfiguration into focused MeticaInitConfig (core SDK params) and MeticaMediationInfo (ad network config)
  • Replaced confusing MeticaAdsAssignmentStatus enum with clearer MeticaUserGroup model
  • Changed return type from MeticaInitializationResult to MeticaInitResponse with direct SmartFloors access

🔒 Privacy Compliance

  • Added SetHasUserConsent(bool) for GDPR consent management
  • Added SetDoNotSell(bool) for CCPA compliance
  • Both methods properly propagate to native Android/iOS layers

🧹 Code Quality

  • Fixed inconsistent property casing (userGroupUserGroup, isSuccessIsSuccess)
  • Removed unused/deprecated fields (Version, CustomKeys, configurable BaseEndpoint)
  • Marked obsolete extension methods appropriately
  • Hardcoded production endpoint to reduce configuration errors

Breaking Changes ⚠️

Before:

var config = new MeticaConfiguration {
    ApiKey = "your-api-key",
    AppId = "your-app-id", 
    UserId = "user-123",
    BaseEndpoint = "https://api.metica.com"
    Version = "1.15.5"
};
var result = await MeticaSdk.InitializeAsync(config);
if (result.IsMeticaAdsEnabled) { /* ... */ }

After:

var config = new MeticaInitConfig("your-api-key", "your-app-id", "user-123");
var mediation = new MeticaMediationInfo(
    MeticaMediationType.MAX,
    "your-applovin-sdk-key"
);
var response = await MeticaSdk.InitializeAsync(config, mediation);
if (response.SmartFloors.UserGroup == MeticaUserGroup.TRIAL) { /* ... */ }

rstecca-metica and others added 30 commits September 30, 2025 14:59
…ment has started. Taking steps towards the new API design.

- `Metica.Unity` is no more.
- `Metica.SDK` now depends on `Metica.ADS`
- `Metica.ADS` does NOT depend on `Metica.SDK` anymore.
- `MeticaSdk` now initializes `MeticaAds` too.
- `MaxSdk` still needs app-level initialization (aka up to the user).
…egistering) services at initialization phase.
    {
        // TODO: currently we force trial user group
        _tcs.SetResult(
            new MeticaInitializationResult(MeticaAdsAssignmentStatus.Normal)
        );
        /*
- Move `ILog` to `Metica.Core`
- Substitute all calls to `UnityEngine.Debug.Log` (in `Metica.ADS` classes) with `MeticaAds.Log.LogDebug` (yes... not the nicest call)
# Conflicts:
#	Assets/Plugins/Android/mainTemplate.gradle
#	Assets/StreamingAssets/Metica/sdkInfo.json
Merge branch 'develop' into tomi-unity_bridge

# Conflicts:
#	Editor/MeticaAdsDependencies.xml
#	Runtime/ADS/Metica.ADS.asmdef
#	Runtime/ADS/MeticaAds.cs
#	Runtime/ADS/Platform/Android/AndroidDelegate.cs
#	Runtime/ADS/Platform/Android/BannerCallbackProxy.cs
#	Runtime/ADS/Platform/Android/InitializeCallbackProxy.cs
#	Runtime/ADS/Platform/Android/LoadCallbackProxy.cs
#	Runtime/ADS/Platform/UnityPlayer/UnityPlayerDelegate.cs
#	Runtime/SDK/MeticaSdk.cs
#	Runtime/SDK/SdkConfig.cs
#	package.json
    {
        MeticaAds.Log.LogDebug(() => $"{TAG} SetHasUserConsent called with: {hasUserConsent}");

        _unityBridgeAndroidClass.CallStatic("setHasUserConsent", hasUserConsent);
    }

    public void SetDoNotSell(bool doNotSell)
@antonurankar-moloco
antonurankar-moloco changed the base branch from main to develop October 17, 2025 08:04
@antonurankar-moloco antonurankar-moloco changed the title Tomi unity api MET-5092: Prepare publisher facing API for Unity plugin Oct 17, 2025
@antonurankar-moloco
antonurankar-moloco marked this pull request as ready for review October 17, 2025 10:54
Comment thread Runtime/ADS/MeticaAds.cs
@antonurankar-moloco
antonurankar-moloco merged commit fb79441 into develop Oct 21, 2025
@antonurankar-moloco
antonurankar-moloco deleted the tomi-unity_api branch October 21, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants