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.

I've developed a cloud service (Google cloud Run job) with a webapp that responds to messages as if the replies were from me. When triggered, it reads all my emails and writes a draft as an answer. However, I want to integrate it also with WhatsApp.

I read that I can create an endpoint with the business cloud api so that the software can receive my whatsapp messages, but I realised that I can't save messages as draft with the current API. Indeed, I want to save a response generated by my service as a draft in WhatsApp, so when I open WhatsApp, the message is already there under the intended contact.

I've discovered that the "click to chat" functionality (e.g., https://wa.me/myfriendnumber?=hi) partially achieves this.

However, when I open such a link, it launches my browser first, which then prompts me to open the WhatsApp app. I'd like to bypass this manual step, avoiding the "Open in WhatsApp" confirmation popup, so that I can open multiple links programmatically and have the messages saved as drafts in WhatsApp directly.

Is there a way to automate this, or another method to achieve the same result?

Hi,
We received this message below but can we get something more specific to solve our issue? (It is kind of generic) "We found that your app has access to the Business Asset User Profile Access permission, but your app's use of this permission is not allowed. This violates Developer Policy 1.9."
When I go to the permissions page, it just list all of the permissions: https://developers.facebook.com/docs/permissions
Can we get other specific details on how to resolve this? Also is there a direct line where we can jump on a call to discuss?
Thanks Josh

I'm working on a Django API that integrates with the Meta API for WhatsApp product feeds. This endpoint works perfectly on my local machine, but when I deploy it to production, it returns a 504 Gateway Timeout error.

Details:

Local Request (Works):

curl -X POST http://127.0.0.1:8000/api/whatseat/save-changes/ -d "business_id=2"

Production Request (504 Gateway Timeout):

curl -X POST https://<production-url>/api/whatseat/save-changes/ -H "Authorization: Token <token>" -d '{"business_id": 2}'

Key Observations:

  • Error happens only in production—locally, the endpoint works fine.
  • When this endpoint is called without the necessary WhatsApp data, it correctly returns a prompt to complete settings. So, the problem seems to occur during an external API request to the Meta (WhatsApp) API.
 def post(self, request):     business_id = request.data.get('business_id')          try:         whatsapp_business = WhatsApp.objects.get(business=business_id)     except ObjectDoesNotExist:         return Response({"message": "Complete WhatsApp setup in settings"}, status=400)          access_token = whatsapp_business.access_token     product_catalog_id = whatsapp_business.catalog_id          if not all([access_token, product_catalog_id]):         return Response({"error": "Missing Access Token or Catalog ID"}, status=400)     # External API request (seems to be the timeout issue in production)     try:         product_feed_data = request.build_absolute_uri(reverse('get-product-feeds'))         response = requests.get(product_feed_data, params={             'access_token': access_token,             'product_catalog_id': product_catalog_id         })         response.raise_for_status()     except requests.RequestException as e:         return Response({'error': str(e)}, status=500)     # Other logic... (contains another call to graph api for uploading the new data feed) 

Troubleshooting Attempts:

  • Local vs. Production Testing: Locally, the endpoint works without issues.

  • Error Isolation: Confirmed the timeout is likely due to the Meta Products Feed API request.

What might cause a 504 Gateway Timeout when accessing the Meta Products Feed API in production, but not locally? Could this be due to server or network configuration differences, or specific Meta API requirements in production? Any advice on addressing API timeouts in Django would be helpful.