Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

VisionForgeX for Flutter

Ads for Flutter apps monetized with VisionForgeX: Google Ad Manager demand (Google Ad Exchange) through your VisionForgeX account. A thin plugin over the native VisionForgeX SDKs; every decision (pacing, floors, refresh, preloading, consent, experiments) is made on the platform and changes without an app update.

Add it

pubspec.yaml:

dependencies:
  visionforgex_flutter:
    git:
      url: https://github.com/VisionForgeX/visionforgex-flutter.git
      ref: 1.0.1

(Once the plugin is on pub.dev this becomes visionforgex_flutter: ^1.0.1.)

iOS: until the native SDK is on CocoaPods' catalogue, add this line inside target 'Runner' do in ios/Podfile:

pod 'VisionForgeX', :git => 'https://github.com/VisionForgeX/visionforgex-ios-sdk.git', :tag => '1.3.0'

Google's SDK on Android: the plugin runs on Google's GMA Next-Gen SDK (Google's preferred Android SDK; compileSdk 35 or higher). To stay on Google Mobile Ads 25.x instead (Google retires it on 30 Jun 2028), add visionforgexEngine=gma to android/gradle.properties. Never add Google's own google_mobile_ads plugin beside this one.

Android: in android/app/src/main/AndroidManifest.xml, inside <application>, the App ID shown on your app's page on VisionForgeX (minSdk 24):

<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-…~…"/>

iOS: in ios/Runner/Info.plist (iOS 13 or later):

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-…~…</string>

plus Google's SKAdNetwork identifiers (list on Google's site). In ios/Podfile, Google's ad SDK is a static library, so change use_frameworks! to use_frameworks! :linkage => :static. Then run cd ios && pod install.

Start it and show ads

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await VisionForgeX.initialize('vfx_…your app key…');
  runApp(const MyApp());
}

// at a natural pause: call at every one; the platform decides whether an ad shows now
final r = await VisionForgeX.interstitial('level_complete').show();   // r.shown, r.reason

// rewarded
await VisionForgeX.rewarded('extra_life').show(onReward: (type, amount) => giveReward());

// a banner
const VfxBanner(placement: 'home_banner')

The key and the placement names are on your app's page on VisionForgeX. App open ads show by themselves on return to the app when the platform turns that on.

Test before you have an account

await VisionForgeX.initialize('demo', options: const VfxOptions(googleDemoAds: true));

Placements: banner, collapsible_banner, interstitial, rewarded, rewarded_interstitial, app_open. See example/.

Privacy options, revenue, events

if (await VisionForgeX.isPrivacyOptionsRequired()) await VisionForgeX.showPrivacyOptions();
VisionForgeX.revenue.listen((r) { /* r.valueMicros, r.currency → Firebase or your own records */ });
VisionForgeX.events.listen((e) { /* req, fill, nofill, show, click, close, fail, reward, paid, capped */ });

Ad revenue in AppsFlyer or Adjust

When VisionForgeX switches it on for your app, each impression's revenue is sent to the attribution tool the app already runs, with no Dart to write: AppsFlyer 6.15 or newer (its Flutter plugin appsflyer_sdk) or Adjust (its Flutter plugin adjust_sdk). Add and start that tool as its own guide says; VisionForgeX finds it in the app and never starts or sets it up. Not in the app: nothing is sent. Demo ads are never sent. Don't also send VisionForgeX.revenue to the same tool from your own code, or each impression counts twice. Needs the native SDKs 1.3.0, which this plugin uses from 1.0.1.

Status

1.0.1 (on the native SDKs 1.3.0) is released on GitHub. Its Dart layer is tested and CI builds the example for Android and iOS on every push. Native ads are not in this version.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages