InterstitialAd object is there in Admob and Facebook - facebook

Background : I am trying to have the Interstitial Ads from Admob and Facebook separately (Not via Mediation) . The facebook Ads will be triggered if the App is installed from Amazon App store.
Question : I need to declare the variable interstitialFromAdmob and interstitialAdFromFacebook. interstitialFromAdmob is for the Ad from Admob and interstitialAdFromFacebook is for the Ad from Facebook. For this Admob and Facebook has used the same Object InterstitialAd. Hence I am unable to declare the variables pointing the Admob and facebook separate. Please let me know how to resolve this
InterstitialAd interstitialFromAdmob;
InterstitialAd interstitialAdFromFacebook;

This is a very common case.
For those classes have duplicated short class name, a long or full path class name shall be used.
For examples, you can use:
com.facebook.ads.InterstitialAd internstitialAdFromFacebook;

Related

flutter ad's only display in test mode

I try to implement ad mob package in my flutter app. I have create my admob account, I choose reward ad, I have my Id bloc and my appId, I have add my google-services.json in the app folder,I have completed the manifest.
My problem is when I use
.load(adUnitId: RewardedVideoAd.testAdUnitId, targetingInfo: targetingInfo)
It's OK I can see video ad after press button, but it's not my unitID
If I use my UnitID like that
.load(adUnitId:"ca-app-pub-xxxxxxxxxxxx/xxxxxxxxx", targetingInfo: targetingInfo)
I have no video ad after press button
I have this error
error in showing ad: PlatformException(ad_not_loaded, show failed for rewarded video, no ad was loaded, null)
I have since long time a bug with release mode, so I launch only in debug mode, it can be the source of my problem ?
Are there a delay of use after creation of admob account or bloc ?
thank you
ads show when u publish your app in the store so if the test ads work's fin than your ads work perfact

facebook-java-sdk unable to create "Ad", says using instagram a/c as placement when not really using anything

I am trying to create Ad using facebook-java-sdk
val adCreative = new AdAccount(ACCOUNT_ID, context).createAdCreative()
.setName(s"Test Creative +$TEST")
.setObjectStorySpec(
new AdCreativeObjectStorySpec()
.setFieldLinkData(
new AdCreativeLinkData()
.setFieldCaption("http://www.field-caption.com")
.setFieldImageHash(attachment1.getFieldImageHash)
.setFieldLink("http://www.google.co.in")
.setFieldMessage("try it out")
)
.setFieldPageId(FACEBOOK_PAGE)
)
.execute()
val ad = new AdAccount(ACCOUNT_ID, context).createAd()
.setName(s"Test Ad +$TEST")
.setAdsetId(adSet.getId)
.setCreative(adCreative.getId)
.setCreative(new AdCreative().setFieldId(adCreative.getId()))
.setStatus(Ad.EnumStatus.VALUE_PAUSED)
.execute()
However the createAd calls fails and results into exception with
com.facebook.ads.sdk.APIException$FailedRequestException: {"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_subcode":1772103,"is_transient":false,"error_user_title":"Instagram Account Is Missing","error_user_msg":"You're using Instagram as a placement. Please select an Instagram account to represent your business in your Instagram ads, or select a Facebook Page to use instead.","fbtrace_id":"FtpWRXVY1tH"}}
This was working fine couple of days back, but all of sudden has started throwing an exception. Any help would be appreciated.
I'd like to add to this answer since i just fought with this issue.
Our long running app that managed boosting just stopped working this month and was throwing the error the OP mentioned.
It appears that the default settings on Facebook's side changed. The docs state that the defaults are facebook, audience_network, messenger
Looking in the Ads Manager, it shows that the placement for the failed boost attempt now includes instagram as a placement. There doesn't seem to be any mention of this change anywhere that I could find.
So I did have to change the call to explicitly define facebook, audience_network, messenger as my publisher_platform setting and not rely on the defaults.
You can explicitly specify publisher platform to publish only on facebook
val adSet = new AdAccount(ACCOUNT_ID, context).createAdSet()
.setName(s"Test AdSet +$TEST")
.setLifetimeBudget(20000L)
.setStartTime(currentDateTime.toString())
.setEndTime(currentDateTime.plusDays(1).toString())
.setCampaignId(campaign.getId())
.setIsAutobid(true)
.setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS)
.setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_POST_ENGAGEMENT)
.setTargeting(
new Targeting()
.setFieldCustomAudiences(List(idNameCusAudience).asJava)
.setFieldPublisherPlatforms(List("facebook").asJava)
)
.setStatus(AdSet.EnumStatus.VALUE_PAUSED)
.execute()
None of these answers really answer what you need to do if you want to include Instagram.
In order to post to instagram you need an instagram account ID.
Every single page on Facebook has (or can have) an instagram 'account' without the user creating one.
What you need to do is (in this order):
Check if they have an instagram linked (if they do you use this ID)
Check for page_backed_instagram_accounts to see if their page has an instagram account that Facebook made for them to be able to advertise (this account is hidden and cannot be found on instagram) if they have this, use the ID from this account.
If for some reason their page has no instagram nor does it have page_backed_instagram_accounts then you will need to create a page_backed_instagram_account
The endpoints you are looking for are:
https://graph.facebook.com/v3.1/[pageId]?fields=instagram_accounts
https://graph.facebook.com/v3.1/[pageId]?fields=page_backed_instagram_accounts

Admob unitid not workigng with reactnative but test unit id does work?

I am facing a weired situation where i have implemented a googleadmob in react native app.
<AdMobBanner
bannerSize="fullBanner"
adUnitID="ca-app-pub-3940256099942544/6300978111"
testDeviceID="EMULATOR"
didFailToReceiveAdWithError={this.bannerError} />
where ca-app-pub-3940256099942544/6300978111 is the test id provided by googleadmob
but when i created new Adunit ID and replaced test id with the newly created ad unit id i am unable to any ads Why ??
Note : i am working on dev environment i guess it won't affect but still ..
Try to remove testDeviceID="EMULATOR" when you run on real device.
Sometimes AdMob may take some times to active the ad unit, please ref to: How long does it take for an AdMob Ad unit ID to become active?
One more point, did you input your payment info on AdMob website, AdMob needs your info to serve your ads.

How to setup Facebook App Request from Unity with Prime31 Social combo plugin?

my problem is this, when the user is asked to select friends from the list and click on Send I receive a Success state from callback but no request is reached from the people selected in the list.
My setup is this:
- my app is a native app for iOS and Android made in Unity
- my app is registered in Facebook developer portal as Game/Puzzle, I set up bundle id, package name, display name and namespace
- my app is not yet published
- I configured the Prime31 Facebook plugin with the appId given from Facebook and Display Name
I send my request like this:
public void AskLifesOnFacebook()
{
var parameters = new Dictionary<string, string>
{
//{ "app_id", "#######my_app_id_number####" },
{ "method", "apprequests" },
{ "title", "My request title" },
{ "message", "My request text" }
};
FacebookCombo.showDialog("apprequests", parameters);
}
But still the friends selector is shown up correctly on an overlay windows, I select friends and send the request but no request is received.
Am I missing something in the configuration of my app on Facebook? Do I need to pass some kind of certification?
From the same app the stream.publish is working correctly and I can publish on user walls.
The setup with Prime31 plugin and the call are correct!
You have to enable "Single Sign On" and "Deep Linking" in Facebook app parameters and add a valid itunes ID for your app (while testing you can put any valid ID, but you should create a itunes connect entry for your app and get the final ID).
When your app is a native iOS app, the users see the notifications only through the Facebook iOS app, so they are guarantee they can open iTunes or run the game.
Global notifications instead (ej: regular browser on PC) are seen if the app is in a Facebook Canvas.

BlackBerry Facebook jar file in eclipse

I know this might sound a very basic question but I am having an issue in using Facebook SDK for Blackberry. I have downloaded the latest one 0.8.25. I have imported them in my eclipse and they are present in the referenced libraries. I have a game app where I want the users to login using their facebook account. Which class contains the code for logging in? Are the jar files implementable or they are just for reference? I have read forums posts where users say that they executed Strawberry program but I can no where find any executable source code. Kindly please let me know how do I create a login page for BlackBerry using its SDK. I did go through another link of Sample Code here!
Let me know which class has login code or how do i use the SDK
At the very basic least, you need to get an instance of the Facebook object and call getCurrentUser(). So, for example:
String[] permissions = new String[] { Facebook.Permissions.ALL_PERMISSIONS };
Facebook fb = Facebook.getInstance(new ApplicationSettings(myNextUrl, myAppId, myAppSecret, permissions));
User fbUser = fb.getCurrentUser();
The code in the library will handle all of the details like getting the user to login to facebook account and accept the requested permissions and so on. You'll want to wrap that all in a try/except to catch FacebookException for error conditions (e.g. user refuses your request).