Skip to main content

unified_ads_unity 1.0.0 copy "unified_ads_unity: ^1.0.0" to clipboard
unified_ads_unity: ^1.0.0 copied to clipboard

Unity Ads adapter for unified_ads. Add it to link only the Unity Ads SDK into your Android and iOS app.

example/README.md

unified_ads_unity example #

Add the core package and this adapter. Only the Unity Ads SDK is linked into your app.

dependencies:
  unified_ads: ^1.0.0
  unified_ads_unity: ^1.0.0

The adapter registers itself through Flutter's plugin registrant, so you don't need to import it.

import 'package:flutter/widgets.dart';
import 'package:unified_ads/unified_ads.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await UnifiedAds.init(AdConfig(
    testMode: true, // never ship with test mode on
    networks: {
      AdNetwork.unity: NetworkConfig(
        appId: 'your-game-id', // Unity Game ID
        bannerAdUnitId: 'your-banner-id',
        interstitialAdUnitId: 'your-interstitial-id',
        rewardedAdUnitId: 'your-rewarded-id',
      ),
    },
  ));

  final rewarded = RewardedAd(
    onEarnedReward: (ad, reward) =>
        debugPrint('${reward.amount} ${reward.type} from ${ad.servedBy}'),
  );
  if ((await rewarded.load()).isSuccess) await rewarded.show();
}

Banner: UnifiedBannerWidget(ad: BannerAd(size: const BannerSize.adaptiveAnchored()), anchored: true).

Platform setup (manifest, Info.plist, SKAdNetwork IDs): doc/setup/unity.md. For a full app with every network, a settings screen and a live event log, see the example app.

0
likes
150
points
494
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Unity Ads adapter for unified_ads. Add it to link only the Unity Ads SDK into your Android and iOS app.

Repository (GitHub)
View/report issues
Contributing

Topics

#ads #unity-ads #monetization

License

MIT (license)

Dependencies

flutter, meta, unified_ads_platform_interface

More

Packages that depend on unified_ads_unity

Packages that implement unified_ads_unity