How to apply Admob code with real App id and unit id..? - android

I'm very new to Android and I want to launch my first application but I'm facing problem while I'm trying to apply AdMob code in my application.
When I check my code with test ad id it is working fine but when I'm using the same code with my real AdMob App id and Unit id this give me no add in my frame and the Logcat is showing me this.
19 5029-5216/com.example.aviralchauhan.demoplayer E/FA: GoogleService failed
to initialize, status: 10, Missing google app id value from from string
resources with name google_app_id.
2019-07-23 12:14:10.330 5029-5216/com.example.aviralchauhan.demoplayer E/FA:
Missing google_app_id. Firebase Analytics disabled 2019-07-23 12:14:10.336 5029-5216/com.example.aviralchauhan.demoplayer E/FA:
Uploading is not possible. App measurement disabled
As you suggested that this is duplicate question so can you please explain that it's really important to connect the application with firebase to show to ads in my application as I already told you test ads are working fine.

No, it is not really necessary to integrate Firebase with Google but it is recommended so as to get detailed statics over how the user acts over your app and their interaction with the app.
Now, the main topic: Why the add code is not working?
I am sure that you have something like this in your manifest.xml file:
<manifest>
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="YOUR_ADMOB_APP_ID"/>
</application>
</manifest>
There, the text YOUR_ADMOB_APP_ID must be replaced by a real ID which you will get by adding your app to the AdMob dashboard. Check this to get the real ID.

<manifest>
<application>
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>
</application>
set on app AndroidManifest.xml file

Related

Get appId with AGConnectServicesConfig failed

I have some doubts about this message in the logcat :
E/HMSSDK_AGCUtils: Get appId with AGConnectServicesConfig failed
If this error or message could give problems in the future since it is displayed when viewing the Maps Kit Map?
I have already tried the following:
No apply plugin of agconnect in build.grade
Manually add
<meta-data
android:name="com.huawei.hms.client.appid"
<!-- Replace xxx with the actual app ID, which can be obtained on the App information page. --> -->
android:value="appid=xxx">
</meta-data>
<!-- Replace xxx with the actual payment ID, which can be obtained from the app's IAP information. --> -->
<meta-data
android:name="com.huawei.hms.client.cpid"
android:value="cpid=xxx">
</meta-data>
But the message keeps popping up, is there anything else to consider? Would this message affect in some future?
Thank for for providing the information regarding this issue.
This E/HMSSDK_AGCUtils: Get appId with AGConnectServicesConfig failed message is printed when the HMS framework cannot get the AppID from AppGallery, if your App hasn't been uploaded onto the AppGallery, it is normal to show this message.
The framework will then get the AppID from agconnect-services.json file or manifest.xml, and the information is used by framework itself, will not influence the usage of Map Kit.

CloudOnce not merging correctly the manifest

Using Unity and CloudOnce,
I am implemeting cloudonce in my app withouth successfull, so I started a new project , just added the cloudonce and set up it correctly,
but it crashed, After look up in the logs on logcats the error was
"Using Google Play games services requires a metadata tag with the
name "com.google.android.gms.games.APP_ID" in the application tag of
the manifest for com.xxx.xxx"
after further look in the manifest, I miss this
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="#string/app_id" />
After look in the Plugins/Android/AndroidManifest there is no meta data with the app id either
You can either run the Android setup from the Unity Menu or invoke it statically with the correct values. If you just want to add the app id property to the AndroidManifest.xml, you can escape it with a space to force the parser to interpret the app id as a string. This is what the plugin does when you run setup.
For example:
<!-- The space in these forces it to be interpreted as a string vs. int -->
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="\ 1213456789" />

Disable Firebase crash reporting

I have decided to include the Firebase Crash API 9.0.1 into my Android app.
At the moment everything is working fine. Now I want to give my users the opportunity to disable, that Firebase is sending the Crash reports automatically.
Firebase Analytics can be disabled with this code snippet
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(false);
Does anyone of you know a similar way to disable crash reporting?
Many thanks
Sorry for short answer but currently there is no official support for this.
EDIT: 30/10/2017
Now it is possible to enable/disable at build time adding in the AndroidManifest.xml:
<meta-data android:name="firebase_crash_collection_enabled" android:value="false" />
or runtime using:
FirebaseCrash.enableCrash(true|false);
More info here.
Yes it is possible now. Check this,
Disable Crash Reporting
Simply add the below line to your code in the first activity or even better in the Application class.
FirebaseCrash.setCrashCollectionEnabled(false);
To enable,
FirebaseCrash.setCrashCollectionEnabled(true);
This is really helpful when we have multiple build types such as Debug, Release etc.
You can find the instructions on the page:
https://firebase.google.com/support/guides/disable-analytics
Disable Analytics collection on Android
Temporarily disable collection
If you wish to temporarily disable Analytics collection, such as to get end-user consent before collecting data, you can set the value of firebase_analytics_collection_enabled to false in your app's AndroidManifest.xml in the application tag. For example:
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />
To re-enable collection, such as after an end-user provides consent, call the setAnalyticsCollectionEnabled() method of the FirebaseAnalytics class. For example:
setAnalyticsCollectionEnabled(true);
If you need to suspend collection again for any reason, you can call
setAnalyticsCollectionEnabled(false);
and collection is suspended until you re-enable it.
Permanently deactivate collection
If you need to deactivate Analytics collection permanently in a version of your app, set firebase_analytics_collection_deactivated to true in your app's AndroidManifest.xml in the application tag. For example:
<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />

Fiksu SDK Integration

I am trying to implement Fiksu SDK for Android and iOS.
I am able to add code to track registration and purchase :
FiksuTrackingManager.uploadRegistration(Context, FiksuTrackingManager.RegistrationEvent.EVENT1);
FiksuTrackingManager.uploadPurchase(Context, FiksuTrackingManager.PurchaseEvent.EVENT1, 0, "USD");
In iOS i am able to get the logs in the console, but in android i am only getting logs which event is called.How can i check the logs in Android ?
Also how to track the app events in Fiksu dashboard ?
They have also mentioned to add client id , from where will i get the client id ?
if any one has implemented it please guide me how to proceed ?
this might be too late but it may help someone that comes across this post.
I just had to integrate the Fiksu SDK for android for a client and face similar issues when testing.
How can i check the logs in Android ?
If the SDK has been properly installed you should be able to see some logs like below which means the events have been succesfully sent to their server.
11-25 10:04:31.010 21588-23132/ D/FiksuTracking? Event: Resume
11-25 10:04:32.320 21588-23132/ D/FiksuTracking? Successfully uploaded tracking information.
11-25 10:05:40.500 21588-23383/ D/FiksuTracking? Event: Purchase
11-25 10:05:42.180 21588-23383/ D/FiksuTracking? Successfully uploaded tracking information.
how to track the app events in Fiksu dashboard ?
This part is quite annoying as they don't have a way to create Apps in the dashboard and link them to your android app so you can see your events coming through. Instead you have to actually perform the test and send them an email for someone from Fiksu to check their servers and track your events.
These are the test steps as per their documentation:
Download and install your application on an Android device and perform your tests.
Fill a form they have and send it via email to their support team.
Someone will get back to you confirming if they have received your events.
They have also mentioned to add client id , from where will i get the client id ?
The clientId is just an identifier for your users within your app. In other words you can set that to whatever you want (e.i. email address). The suggestion is to set this after a user has registered or logged in in your app.
FiksuTrackingManager.setClientId(Context, "XXX");
Based on their documentation: "Where XXX would be the ID you want to send and can be any alphanumeric string up to 64 characters long. All events sent after this call is made would send the Client ID that has been set. If you call setClientID again it will overwrite whatever was there before. However the first Client ID sent with an event will be the Client ID that is in the export on the Fiksu Client Dashboard and it will not get updated."
if any one has implemented it please guide me how to proceed ?
So to sum up below are the steps to integrate the Fiksu SDK for android.
Downlaod the SDK.
Add the SDK jar to your project.
Set the isntall receiver (Only if you want to track app installs). NOTE that they expect to be the only receiver in the AndroidManifest.xml file. If you are using other third party SDKs to track the same you either:
Use fiksu to forward the intent:
<receiver android:name="com.fiksu.asotracking.InstallTracking"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
<!-- Forward to other receivers -->
<meta-data android:name="forward.1"
android:value="com.google.android.apps.analytics.AnalyticsReceiver" />
<meta-data android:name="forward.2" android:value="com.mypackage.thirdparty.MdotmReceiver" />
</receiver>
Or set the below flag in your AndroidManifest and have another install receiver forward it to the fiksu SDK.
<meta-data android:name="FiksuDisableReceiverCheck" android:value="true" />
Set the permissions in your AndroidManifest.
android.permission.INTERNET
android.permission.READ_PHONE_STATE
Initialize the SDK. Normally on your Application onCreate() method.
FiksuTrackingManager.initialize(this);
Setting up Google Play Services on your project.

can't see admob banners in libgdx app

I added the code as it is written
here
But I can't see banners with ads in my game.
My app is published. But the current version is not published yet.
I've added to manifest:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
There is a similar thread
here
But I could not understand the answer there.
They wrote:
You don't need to have an app already on the market to get a Publisher ID for a new app.
In the Android Package URL field that's on the "Add Site/App" form, just enter
"market://details?id=your.package.name". You'll of course want to replace the
'your.package.name' with your app's actual package name.
The viewWidth warnings are fine and you will likely still see them after inserting
your Publisher ID.
I don't understand where should I include "market://details?id=your.package.name".
Logcat shows me the following errors:
w/Ads (3200) Invalid unknown request error: Cannot determine request type.
Is your ad unit id correct?
w/webcore(3200): can't get the viewwidth after the first layout
My publisher key is correctly inserted to the code.
BTW it was printed in logcat. (Is it possible to exclude printing it?)
Thanks
You don't need to have an app already on the market to get a Publisher
ID for a new app. In the Android Package URL field that's on the "Add
Site/App" form, just enter "market://details?id=your.package.name".
You'll of course want to replace the 'your.package.name' with your
app's actual package name. The viewWidth warnings are fine and you
will likely still see them after inserting your Publisher ID.
This is related to Admob, when adding an application to Admob (via admob.com) its not required to have the app published in the market. Admob will ask you for the package name, its ok to write a package name that is not yet published in the Android Market.

Categories

Resources