vmax_flutter 0.0.1 copy "vmax_flutter: ^0.0.1" to clipboard
vmax_flutter: ^0.0.1 copied to clipboard

outdated

VmaxFlutter SDK allows the publishers to display wide variety of ads.

vmax_flutter #

VmaxFlutter SDK allows the publishers to display wide variety of ads.

Getting Started #

Prerequisites for iOS #

  • Use Xcode 13.3.1 or higher
  • Target iOS 12.0 or higher

Prerequisites for Android #

Initialize VmaxFlutterManager #

It's the first & foremost step in VmaxFlutter SDK. Publishers need to initialize the VmaxFlutterManager class before making an ad request.

To initialize VmaxFlutterManager you need to register with Vmax & generate an accountId, appId & secretKey from the Vmax Console

Before Initializing the VmaxFlutterManager developer needs to initialize VmaxFlutterUser first & pass user-specific targeting information. User-related parameters like id, gender, age, city, region, country, zip-code & keywords that can be used for custom targeting:

VmaxFlutterUser vmaxUser = VmaxFlutterUser.instance;
vmaxUser.setId("USER_ID");
vmaxUser.setGender("USER_GENDER");
vmaxUser.setAge("USER_AGE");
vmaxUser.setCity("USER_CITY");
vmaxUser.setRegion("USER_REGION");
vmaxUser.setCountry("USER_COUNTRY");
vmaxUser.setZipCode("USER_ZIPCODE");
vmaxUser.setKeywords(["USER_KEYWORD"]);

Now use the appId, accountId & secretKey in VmaxFlutterManager initialize(accountId:, appId:, secretKey:, listener:) method to set up the VmaxFlutter SDK. Use InitializationStatusListener for relevant Initialization status.

Initializing VmaxFlutter library will validate the appId, get targeting data for users using accountId & secretKey, and fetch the user-agent, IDFA, and device information used in every subsequent ad request.

VmaxFlutterManager.instance.initialize(accountId: ACCOUNT_ID, appId: APP_ID, secretKey: "SECRET_KEY", listener: InitializationStatusListener(
  onSuccess: (){
    print("VmaxManager Initialization Success");
  },
  onFailure: (){
    print("VmaxManager Initialization Failed");
  })
);

Create AdSpace #

VmaxFlutterAdSpace represents a space reserved for displaying a single ad. Developers can use this space to display a wide variety of ads. To display an ad you need to create TAG_ID from the Vmax console and then use it to monetize the adSpace.

Developers need to listen for VmaxFlutterAdSpaceListener which tells them the current state of the adSpace.

To create VmaxFlutterAdSpace follow these steps to create one:

NOTE:- VmaxFlutterManager InitializationStatusListener status should be successful before creating a VmaxFlutterAdSpace.

  • Create an instance of VmaxFlutterAdSpace by providing tagId & registering VmaxFlutterAdSpaceListener in the constructor of VmaxFlutterAdSpace.
VmaxFlutterAdSpace _adSpace = VmaxFlutterAdSpace(tagId: "TAG_ID", listener: VmaxFlutterAdSpaceListener(
    onAdReady: () {
      print("VmaxFlutterAdSpace onAdReady");
    },
    onAdRender: (){
      print("VmaxFlutterAdSpace onAdRender");
    },
    onAdError: () {
      print("VmaxFlutterAdSpace onAdError");
    },
    onAdClick: (){
      print("VmaxFlutterAdSpace onAdClick");
    })
);
  • After creating a VmaxFlutterAdSpace, you need to call the cacheAd() to send an ad request to the Vmax server.

  • When you receive a callback from onAdReady from VmaxFlutterAdSpaceListener use the VmaxWidget class & pass the VmaxFlutterAdSpace object in them.

VmaxWidget(adSpace: _adSpace)

What is VmaxWidget? #

VmaxWidget displays a VmaxFlutterAdSpace as a Flutter widget.

The developer must call the cacheAd() before showing the widget. Otherwise, a PlatformException will be thrown.

1
likes
0
points
17
downloads

Publisher

verified publishervmax.com

Weekly Downloads

VmaxFlutter SDK allows the publishers to display wide variety of ads.

Homepage

License

unknown (license)

Dependencies

flutter, google_mobile_ads, webview_flutter

More

Packages that depend on vmax_flutter

Packages that implement vmax_flutter