How to use Facebook Graph API for archive ads
I have created a meta developer account to use Graph API but I'm facing restrictions. I want to be able to browser ads relate to a keyword. What are the possible solutions?
Tony-Marketing-API.cn is a vibrant community dedicated to Facebook, Meta,Google Ads api, app development, Instagram, and related technologies. It offers valuable bug solutions, troubleshooting cases, and problem-solving strategies shared by users. Stay updated with real-world solutions, development tips, and the latest trends in digital marketing and app development.
I have created a meta developer account to use Graph API but I'm facing restrictions. I want to be able to browser ads relate to a keyword. What are the possible solutions?
What I am doing doing
What I am trying to understand
onAdImpression()
is not triggered when the view is rendered in the screen instead its triggered when I click the AD, GO to the designated AD and return back to the APP where the AD container is presentonAdImpression()
should be triggered as soon as the AD is rendered on the screen@Composable fun BannerAdView(adUnitId: String) { val context = LocalContext.current val adView = remember { AdView(context) } AndroidView( factory = { adView.apply { setAdSize(AdSize.BANNER) this.adUnitId = adUnitId adListener = object : AdListener() { override fun onAdLoaded() { // Called when an ad is loaded. } override fun onAdFailedToLoad(error: LoadAdError) { // Called when an ad fails to load. } override fun onAdOpened() { // Called when an ad opens an overlay that covers the screen. } override fun onAdClicked() { // Called when an ad is clicked. } override fun onAdClosed() { // Called when the user is about to return to the app after tapping on an ad. } override fun onAdImpression() { // Called when an ad impression is recorded. Log.d("AdImpression", "Ad impression recorded") } } loadAd(AdRequest.Builder().build()) } }, update = { it.loadAd(AdRequest.Builder().build()) } ) }
I am facing ANR (Application Not Responding) issues in my Android application related to the initialization of the Mobile Ads SDK. I have a class named GoogleAdsManager where I perform the initialization in the initAds() function, and this function is called in the onCreate() method of the main Application class.
Here is a simplified version of my code:
class GoogleAdsManager { fun initAds(context: Context) { // Other initialization tasks MobileAds.initialize(context) } }
And in my Application class:
class MyApplication : Application() { override fun onCreate() { super.onCreate() val googleAdsManager = GoogleAdsManager() googleAdsManager.initAds(this) } }
The issue is that I am receiving ANR reports on various devices, but I am unable to reproduce it on my own device. Firebase Crashlytics reports indicate that this ANR occurs more frequently than usual.
I suspect that the MobileAds.initialize(context) call might be the culprit. However, since I cannot reproduce the issue locally, I am seeking advice on how to investigate and resolve ANR issues related to the Mobile Ads SDK initialization.
Has anyone experienced similar ANR issues with MobileAds.initialize()? Are there specific scenarios or devices where such ANRs are more likely to occur? Are there alternative approaches or best practices for initializing Mobile Ads SDK to avoid ANR issues? Any insights or suggestions on how to address this ANR issue would be greatly appreciated. Thank you!
var adRequested by remember { mutableStateOf(false) } if (AdEventManager.isInternetAvailable() && !adRequested && isNativeAdVisible && !App.isAppPremium) { AndroidViewBinding( NativeNoMediaCLayoutBinding::inflate, modifier = Modifier .fillMaxWidth() .weight(1f) .navigationBarsPadding() ) { App.mInstance?.adsManager?.loadNativeAd( context as Activity, adFrame, AdsManager.NativeAdType.NOMEDIA_MEDIUM, context.getString(R.string.ADMOB_NATIVE_WITHOUT_MEDIA_V2), shimmerLayout) } adRequested = true }
so here i want that when the ad is Loaded once then it should not be loaded again and again whenever the screen is recomposed so we go with a state that tracks that if the ad is loaded or not but the issue we have here is that even we cant make a side effect that will run this block only when its true.As by this code request is sent one time but when the screen recompose the ad is hidden as we have that in the if statement So how to make sure that the ad is loaded once and if was loaded then that View should remain same and don't reload
I have an Android app targets children. I want to create an app install campaign for it. But when i select it an conversion action for it isn't created automatically. And because app targets children i can't create a conversion action for it myself. I have multiple apps on Play Store. When i try it for them most of them are creates a conversion action automatically and some of them doesn't. Can you help? https://imgur.com/gallery/4B4axkV