सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
एक फ्लटर प्लगइन जो मोबाइल एप्लिकेशन में फायरबेस नेटिव एडमॉब के एकीकरण की अनुमति देता है, जो दोनों iOS और एंड्रॉइड प्लेटफॉर्म का समर्थन करता है। यह डेवलपर्स को अपने ऐप के UI के भीतर मूल विज्ञापनों को बिना किसी उपयोगकर्ता अनुभव के बाधा के बिना प्रदर्शित करने की अनुमति देता है। प्लगइन फायरबेस के एडमॉब सेवा का उपयोग करके मूल विज्ञापनों को लोड और रेंडर करने के लिए एक सीधी-आसान API प्रदान करता है। यह नवीनतम फ्लटर संस्करणों के साथ काम करने के लिए डिज़ाइन किया गया है और विज्ञापन प्रदर्शन और संगतता के लिए सर्वोत्तम अभ्यास का पालन करता है।
उपयोग
मोबाइल ऐप्स को नेटिव एड्स के साथ मनीकरन करना
Flutter ऐप्स में Firebase-संचालित विज्ञापनों को एकीकृत करना
एप्लिकेशन कंटेंट में रिच मीडिया विज्ञापन प्रदर्शित करना
मूल विज्ञापन प्रारूपों के साथ उपयोगकर्ता एंगेजमेंट में सुधार करना
एक कोडबेस के साथ iOS और Android दोनों का समर्थन करना
मुख्य विशेषताएँ
Firebase Native AdMob एकीकरण
क्रॉस-प्लेटफॉर्म समर्थन (iOS और Android)
विज्ञापन लोडिंग और रेंडरिंग के लिए सरल API
AdMob नीतियों के अनुपालन में
रियल-टाइम विज्ञापन प्रदर्शन ट्रैकिंग
इनके लिए उपयुक्त
विज्ञापन मुद्रीकरण की तलाश में Flutter विकासकर्ता
मूल विज्ञापन प्रारूप की आवश्यकता वाले ऐप
Firebase के रूप में बैकएंड का उपयोग करने वाले प्रोजेक्ट
iOS और Android दोनों के लिए विकास करने वाले विकासकर्ता
उच्च विज्ञापन भागीदारी के लिए लक्षित ऐप्स
विचार योग्य बातें
Firebase सेटअप और कॉन्फ़िगरेशन की आवश्यकता है
विज्ञापन उपलब्धता नेटवर्क और क्षेत्र पर निर्भर करती है
अगर अनुकूलित नहीं किया गया है, तो ऐप प्रदर्शन पर प्रभाव पड़ सकता है
विज्ञापन जीवन चक्र घटनाओं का सही तरीके से निपटान की आवश्यकता है
AdMob नीतियों का पालन अनिवार्य है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
flutter_native_admob
Plugin to integrate Firebase Native Admob to Flutter application
Platform supported: iOS, Android
Getting Started
For help getting started with Flutter, view our online documentation.
Setup Android project
Add the classpath to the [project]/android/build.gradle file.
dependencies {
// Example existing classpath
classpath 'com.android.tools.build:gradle:3.2.1'
// Add the google services classpath
classpath 'com.google.gms:google-services:4.3.0'
}
Add the apply plugin to the [project]/android/app/build.gradle file.
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
Add your Admob App ID.
Important: This step is required as of Google Mobile Ads SDK version 17.0.0. Failure to add this tag results in a crash with the message: The Google Mobile Ads SDK was initialized incorrectly.
Important: This step is required as of Google Mobile Ads SDK version 7.42.0. Failure to add add this Info.plist entry results in a crash with the message: The Google Mobile Ads SDK was initialized incorrectly.
In your app's Info.plist file, add a GADApplicationIdentifier key with a string value of your AdMob app ID. You can find your App ID in the AdMob UI.
Stream that notify each time the loading state changed
Stream
void setAdUnitID(String adUnitID)
Change the ad unit ID, it will load the ad again if the id is changed from previous
void reloadAd({bool forceRefresh = false, int numberAds = 1})
Reload the ad with optionals number of ads
void setTestDeviceIds(List ids)
Add your test devices
void setNonPersonalizedAds(bool nonPersAds)
Set the option to disable the personalized Ads. AdMob default option: personalized
Examples
Default
NativeAdmob(
adUnitID: "<Your ad unit ID>"
)
Using controller, loading, error widget, type and options
final _controller = NativeAdmobController();
// Optional: enter your test device ids here
_controller.setTestDeviceIds([
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
]);
// Optional: Set the option to disable the personalized Ads. AdMob default option: personalized
_controller.setNonPersonalizedAds(true);
NativeAdmob(
adUnitID: "<Your ad unit ID>",
loading: Center(child: CircularProgressIndicator()),
error: Text("Failed to load the ad"),
controller: _controller,
type: NativeAdmobType.full,
options: NativeAdmobOptions(
ratingColor: Colors.red,
// Others ...
),
)
When putting NativeAdmob in ListView/GridView, it will keep reloading as the PlatformView init again when scrolling to the item. To prevent from reloading and take full control of the NativeAdmob, we can create NativeAdmobController and keep it