Admob and facebook mediation - android

Its the first time I am integration ads in android. I have integrated Admob using google tutorial. Now, I want to use Admob Firebase with Facebook mediation.
I followed mediation tutorial but I haven't created a facebook app yet. Also, in tutorial, it says to compile .jar files but SDK files I downloaded are in .aar format. There is also 4 folders in downloadeded file (facebook-android-sdk-4.12.1). Which one should I use? I facebook Audience Network tutorial, it only guides us to use facebook Ads standalone by creating Placement Id's for facebook ads but I already have Admob Ad Unit Id. I didn't find any facebook tutorial for mediation.
Can someone explain to me the steps which I need to perform to enable facebook ads mediation after integration of AdMobs with firebase?

Firebase Admob Mediation ANE For Adobe Air
Google Firebase Admob Mediation Ane provides as3 api for flex and flash developer to integrate admob,unityads,inmobi,chartboost,vunlge and gdt into adobe air ios and android app ,support banner Ad,Interstitial Ad,Native Express Ad and Video ,not need java or oc.Support banner,Intersitial,native express ads,Video
Quick Start
Display firebase Banner Ads in as3
Admob.getInstance().showBanner("your banner id",AdmobSize.BANNER_320x50,AdmobPosition.BOTTOM_CENTER);
The AdmobPosition class specifies where to place the banner. AdmobSize specifies witch size banner to show
Remove Firebase Admob Mediation Banner
Admob.getInstance().hideBanner();
Show Admob Native Express Ads
Native express ads is a admob new ad format similar to banner,How to show native express ads in flash air ios and android application? it api similar to banner too.
Admob.getInstance().showNativeBannerAbsolute(nativeID,new AdmobSize(320,132),0,260);
nativeID is got from apps.admob.com format like ca-app-pub-3940256099942544/2562852117
AdSize is the value you set in apps.admob.com
Hide admob native banner
Admob.getInstance().hideNativeBanner();
Show multi banner or native banner at same screen.
if you want to show multi banner at same screen ,set the name of banner as follow.
Admob.getInstance().showBanner("your banner id",AdmobSize.BANNER_320x50,AdmobPosition.BOTTOM_CENTER,0,null,"bannerName1");
hide named banner
Admob.getInstance().hideBanner("bannerName1");
Admob ANE Show Interstitial
Admob.getInstance().cacheInterstitial("interstitial id");
interstitials need to be loaded before shown. show at an appropriate
stopping point in your app, check that the interstitail is ready before showing it:
if (Admob.getInstance().isInterstitialReady()) {
Admob.getInstance().showInterstitial();
}
Set Admob Target Param
set Admob target param such as test Ads and children app
If you want to test the ads or the your app with children target,you can set with admob ANE easy
extraParam=new ExtraParameter();
extraParam.testDeviceID="true";
extraParam.isChildApp=true;
Admob.getInstance().showBanner("banner ID",AdmobSize.BANNER_320x50,AdmobPosition.BOTTOM_CENTER,80,extraParam);
Handle admob events
Firebase admob ane supports all admob native event,you can handle as following
Admob.getInstance().addEventListener(AdmobEvent.onInterstitialReceive, onAdEvent);
private function onAdEvent(event:AdmobEvent):void
{
if (event.type == AdmobEvent.onBannerReceive)
{
trace(event.instanceName,event.data.width, event.data.height);
}
if (event.type == AdmobEvent.onInterstitialReceive)
{
Admob.getInstance().showInterstitial();
}
}
IOS permission config
NSAppTransportSecurity is required for ios 9,to allow http request,it is required to add NSAppTransportSecurity key
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Android permission config
<android>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<application>
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:exported="false"/>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="#android:style/Theme.Translucent"/>
<activity android:name="com.chartboost.sdk.CBImpressionActivity"
android:excludeFromRecents="true"
android:hardwareAccelerated="true"
android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:configChanges="keyboardHidden|orientation|screenSize"/>
<service android:name="com.qq.e.comm.DownloadService" android:exported="false" />
<activity android:name="com.qq.e.ads.ADActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
<activity
android:name="com.unity3d.ads.android.view.UnityAdsFullscreenActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:hardwareAccelerated="true"
/>
<activity
android:name="com.inmobi.rendering.InMobiAdActivity"
android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize"
android:hardwareAccelerated="true"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
tools:ignore="UnusedAttribute" />
<receiver
android:name="com.inmobi.commons.core.utilities.uid.ImIdShareBroadCastReceiver"
android:enabled="true"
android:exported="true"
tools:ignore="ExportedReceiver">
<intent-filter>
<action android:name="com.inmobi.share.id" />
</intent-filter>
</receiver>
<service
android:name="com.inmobi.signals.activityrecognition.ActivityRecognitionManager"
android:enabled="true" />
<activity
android:name="com.vungle.publisher.FullScreenAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"/>
</application>
</manifest>
]]></manifestAdditions>
</android>
ANE ID
<extensionID>com.google.firebase.admob</extensionID>
project home https://github.com/monumentichb/Firebase-Admob-Mediation-ANE

Related

Android - Google OAuth 2 - twice response with different verifier code

I have an issue with Oauth Google on Android 9 and lower.
Settings :
I develop an application with :
Nativescript 7
Angular 11
nativescript-oauth2:3.0.3 plugin
The problem :
I am not sure the problem is from the nativescript-oauth2 plugin, perhaps my android application configuration or Google Frame.
I develop an OAuth login with Facebook and Google provider.
For Facebook, no problem.
Facebook use a web view browser, and Google use a native view browser.
For Google, see bellow :
on emulator with android 10 : all work fine
on emulator with android 8 or 9 :
it open the browser to login with Google => I choose my account => redirect to a Google Page with Waiting message => it never redirect to my app, and after a moment, it redirect to www.google.com
on real device (android 9) with multiple Google account, I have 2 behaviors :
First : it open the browser to login with Google => I choose my account => redirect to a Google Page with "Waiting" message => redirect to my App with The login operation was canceled error message
Second : it open the browser to login with Google => I wait a moment (per example 1 minute) => I choose my account => redirect to a Google Page with Waiting message => redirect to my App => it work fine
on other real Device with just one account Google (in android settings), it is ok
More details :
I debugged the application and the nativescript-oauth2 plugin.
I saw that the Google Frame with Waiting message (after choose a google account) send 2 events to Android with differents values for the "code" parameter.
Of course the first code is expired/revoked and Google return an error.
In the OAuth Google documentation, this is the Step 4 which send 2 responses with 2 codes.
My question
Why the Google Frame browser send me 2 events ?
Code :
Here is my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<application
android:name="com.tns.NativeScriptApplication"
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.tns.NativeScriptActivity"
android:label="#string/title_activity_kimera"
android:launchMode="singleTask"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
android:theme="#style/LaunchScreenTheme">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="#style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Custom URL Schemes -->
<data android:path="/auth"
android:scheme="com.googleusercontent.apps.xxxxxxxx-yyyyyyyyyyyyyyyyyy"/>
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity"/>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="xxxxxxxxxxxxxxxxx" />
</application>
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="__APILEVEL__"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>

Android Facebook ContentProvider and multiple Build Types

I have setup Facebook sharing with the below, build type specific content provider:
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProviderXXX${applicationId} ...
applicationId is different per build type, so that I am able to run debug and live builds side by side on one device.
This setup gives me an error on Facebook (image file) sharing:
IllegalStateException: A ContentProvider for this app was not set up in the AndroidManifest.xml, please add com.facebook.app.FacebookContentProviderXXX as a provider to your AndroidManifest.xml file. See https://developers.facebook.com/docs/sharing/android for more info.
How can I overcome this problem? How can I get Facebook to take into account my applicationId?
You Manifest code look like below for facebook login and sharing:
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/{facebook_app_id}" />
<!-- To use Facebook Login or Share, also add the FacebookActivity to the manifest:-->
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<!-- If you're sharing links, images or video via the Facebook for Android app, you also need to declare
the FacebookContentProvider in the manifest. -->
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider${facebook_app_id}"
android:exported="true" />
NOTE:
Your app is currently live and available to the public.
Follow below step to make your facebook app live and public:
1) Goto https://developers.facebook.com/
2) Select your app and goto App Review tab.
3) Check YES for Your app is currently live and available to the public. option.
See I am new How do I make my app live on FB
Your “applicationId” probably is "com.myname.blabla", and XXX your facebook app id?
I think you should switch to using 2 facebook APP_ID's, and not "applicationId". Put the facebook APP_ID's in your build types and reference them in your manifest. You then don't need to add the "applicationId" from your app.
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider${FACEBOOK_APP_ID}"
android:exported="true" />
Try with this:
If your APP_ID is 95xxx3xx60xx73xx, then it should be like:
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider95xxx3xx60xx73xx"
android:exported="true" />
For more information, you can follow this link.

Bitmap not posting(share) in facebook in android?

I am share to bitmap into facebook all are working fine when app is installed in mydevice.problem when app is not in installed in device.Why this happen i didn't understand.I am using HelloFacebookSample.Java
and i am adding following code Into Manifest.xml file
<activity
android:name=".HelloFacebookSampleActivity"
android:screenOrientation="portrait"
android:theme="#style/AppBaseTheme"/>
<activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/app_id"/>
<provider android:authorities="com.facebook.app.NativeAppCallContentProviderXXXXX92272288220"
android:name="com.facebook.NativeAppCallContentProvider"
android:exported="true"/>
and am adding all permissions also.I am research alot i didn't findout mistake where i done.Advance thanks to all .Sorry ,to my poor english.
When the app is not installed, you can do one of two things:
fallback to a web dialog, but there's no support for sharing a bitmap via a web dialog, so you can only share a link.
Ask for the publish_actions permission, and upload the photo via the Graph API (see https://developers.facebook.com/docs/reference/android/current/class/Request/#newUploadPhotoRequest).
You should always wrap your FacebookDialog calls with a canPresentShareDialog check. See the sample code https://developers.facebook.com/docs/android/share or in the HelloFacebookSample. It will tell you if the share dialog feature is available (if the app is installed and it's of the right version), and you can decide the proper fallback technique to use.

admob ads doesn't show up using milkmangames extension in flash

I have made an app in flash for android and I have followed everything as said here: http://www.adobe.com/devnet/air/articles/admob-ane-android.html to show ads in my app, but the ads ain't showing up, if I place this code:
if(AdMob.isSupported)
{
AdMob.init("my publisher id");
}
else
{
trace("AdMob won't work on this platform!");
return;
}
AdMob.addEventListener(AdMobErrorEvent.FAILED_TO_RECEIVE_AD,onFailedReceiveAd);
function onFailedReceiveAd(e:AdMobErrorEvent):void
{
trace("Ad failed to load.");
}
AdMob.showAd(AdMobAdType.BANNER,AdMobAlignment.LEFT,AdMobAlignment.BOTTOM);
above all the other code nothing works anymore and if I place this code below all the rest code the app works but the ads never show up, does someone know how I can show my ads??
AdMob.isSupported will always return false if you're testing on the simulator. So you've to test on device to be able to test AdMob in general.
I manage to notice that milkmangames Admob ANE has some issues. Just out of the sudden no ads and i mean not a single ad is displayed under intervals of time. milkman games ads aren't displayed without notice. At first i thought it was google fault but unity ads are working perfectly. People are loosing serious amounts of money because of this.
Perhaps google is blocking ads for milkman games ANE?
I had a similar problem, and wrote to Milkman. They politely suggested I read the manual - GettingStarted.pdf, and sure enough, in there is a note about setting up your -app.xml properly.
You need to include certain manifestAdditions in the android section of -app.xml:
<android>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application>
<!-- this meta-data tag is required for AdMob -->
<meta-data android:name="com.google.android.gms.version" android:value="4452000"/>
<!-- this activity is required for AdMob -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
</application>
</manifest>
]]></manifestAdditions>
</android>

After 4 days app is still not indexed in Google Play search

I have published my first application (Voice To SMS) on google play 4 days ago and I still can't find my app in search by it's name or developer name. I can find my app only by package name or by real app name but without spaces - "VoiceToSMS".
Link to my app: https://play.google.com/store/apps/details?id=com.SpeechProcessing.Voice.To.SMS.Converter&hl=en
As we can see, in the bottom of the page there is no even "Similar apps" section...
In Google Play developer console everything seems OK (except that my app is not designed for tablets). 0 errors, I selected all available countries for distribution, app status is "Published". In app description I wrote some keywords.
What could be wrong? Maybe app is not indexed because its name is not specific?
I am attaching manifest.xml additionally:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.SpeechProcessing.Voice.To.SMS.Converter"
android:versionCode="2"
android:versionName="1.0.1" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppBaseTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity
android:name="com.SpeechProcessing.Voice.To.SMS.Converter.MainActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
/>
</application>
</manifest>
Well, more than 2 weeks gone after uploading my app on Google Play. My app is finally searchable by term "voice to sms". In my strong opinion, it wasn't Google-side issue that app wasn't searchable for a while by mentioned term.
I did one SEO trick - in app description I included some keywords whose are popular but not so like "voice to sms". In result, I got more downloads and growing my app's search rank. After few days, my app's rank was enough high that Google could show my app in results of "voice to sms" search term.
So, if you have similar problems - focus on SEO for your app.

Categories

Resources