Posts tagged with flutter

i am using google_mobile_ads: ^5.2.0 to display adds on my flutter app. I need to request and display 3 different sizes of banner ads from google.

This ad is supposed to be show in a scrollable column so i must set the height of it, the problem is that when the add is loaded i don't have the information about the loaded ad, it could be any of the three. If i don't set the height it is either hidden or there is an error that the height cannot be infinite.

note: in the snippet in only set the temporary size, because i don't know how to get the correct one.

 Future<void> loadAd() async {     _bannerAd = AdManagerBannerAd(         adUnitId: adUnitId,         request: const AdManagerAdRequest(),         sizes: [           const AdSize(width: 300, height: 100),           const AdSize(width: 300, height: 250),           const AdSize(width: 300, height: 600)         ],         listener: AdManagerBannerAdListener(           onAdLoaded: (ad) {             if (!mounted) {               ad.dispose();               return;             }             debugPrint('$ad loaded.');             setState(() {               _isLoaded = true;             });           },           onAdFailedToLoad: (ad, error) {             debugPrint('AdManagerBannerAd failed to load: $error');             ad.dispose();           },         ))       ..load();   }   @override   void dispose() {          _bannerAd?.dispose();     super.dispose();   }   @override   Widget build(BuildContext context) {     return _isLoaded && _bannerAd != null         ? Align(             alignment: Alignment.bottomCenter,             child: SafeArea(               child: SizedBox(                 width: _bannerAd!.sizes[0].width.toDouble(),                 height: _bannerAd!.sizes[0].height.toDouble(),                 child: AdWidget(ad: _bannerAd!),               ),             ),           )         : const SizedBox             .shrink();    } 

please help.

Actually continuously Facebook rejected our app due to this reason and I don't have any idea what points are missing and what I want to add to the privacy policy & I put a link to the privacy policy on the settings and login screen already then also they rejecting so if anyone has any suggestion and any supported tool to create a privacy policy without violation please help me.

This response comes from Meta,


I am attaching my privacy policy content here,

Thanks in advance.

I am trying to implement Google Ads into my flutter app. I closely followed the implementation guides but when I start the app even though it says the ad successfully loaded it does not show up. Sometimes it flashes up for a second but immediately disappears afterwords. Does anyone have an idea what could be the problem?

    loadAd() {     BannerAd banner = BannerAd(       adUnitId: adUnitId,       request: AdRequest(),       size: AdSize.banner,       listener: BannerAdListener(           // Called when an ad is successfully received.           onAdLoaded: (ad) {         debugPrint('$ad loaded.');         setState(() {           _isLoaded = true;         });       },           // Called when an ad request failed.           onAdFailedToLoad: (ad, err) {         debugPrint('BannerAd failed to load: $err');         // Dispose the ad here to free resources.         ad.dispose();       }, )     );     banner.load();     setState(() {       _bannerAd = banner;     });   } 
 Widget build(BuildContext context) {     return _isLoaded         ? Container()         : Container(           alignment: Alignment.center,           child: SizedBox(             height: AdSize.banner.height.toDouble(),             width: AdSize.banner.width.toDouble(),             child: AdWidget(               ad: _bannerAd!,             ),           ),         );   } 

When I try to hit

https://graph.facebook.com/me?access_token={{token}} 

using the access token generated from flutter facebook auth on IOS it returns error

{     "error": {         "message": "Invalid OAuth access token - Cannot parse access token",         "type": "OAuthException",         "code": 190,         "fbtrace_id": "A7VLOSLTiXhbqehRbUpNz7z"     } } 

however when I try to generate token from android device and use it in the same endpoint it works fine.

I downgraded flutter facebook auth and same issue still occurs

In the page setup on Meta For Developers it says that the account (test number) does not exist in the Cloud API. I was previously able to run tests normally with the provided test number (receiving messages on my personal phone), but since yesterday afternoon, I've been getting some message like:

"Failed to send message. The account does not exist in the Cloud API. Use the /register API to create an account first."

Making the request in Postman, I have the following response:

"error": {     "message": "The account is not registered",     "type": "OAuthException",     "code": 133010,     "error_subcode": 2593006,     "is_transient": false,     "error_user_title": "The account does not exist",     "error_user_msg": "The account does not exist in the Cloud API. Use /register API to create an account first.",     "fbtrace_id": "A6fN7xoCSrj2t1dW_Qvv5d0" } 

In my Flutter project (VSCode), the Debug Console also shows:

"flutter: {error: {message: The account is not registered, type: OAuthException, code: 133010, error_subcode: 2593006, is_transient: false,..."

Despite my best efforts, I've reached a dead end... help me please.

I've tried everything I can think of: checking all the API settings, sending messages to different numbers, reviewing the documentation, and searching the internet for similar issues. But nothing seems to work. I just need to get the tests running again.