"No Ad Config." on onAdFailedToLoad() Method While trying to Load Ads - android-studio

I am trying to load interstitial advertisements for my app. Whenever I try to load these ads I get a Error saying "No Ads Config" from Domain "com.google.android.gms.ads".
Here is the code:
My AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ayush.torch">
<application
android:allowBackup="true"
android:icon="#drawable/ic_ico"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".main">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="i_have_put_my_app_id_here"/>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
</manifest>
onCreate() in main.java
// Creating the InterstitialAd and setting the adUnitId.
interstitialAd = new InterstitialAd(this);
interstitialAd.setAdUnitId("i have also put my interstitial ad id here");
interstitialAd.setAdListener(new AdListener() {
#Override
public void onAdLoaded() {
Toast.makeText(main.this, "Ad Loaded", Toast.LENGTH_SHORT).show();
}
#Override
public void onAdFailedToLoad(LoadAdError loadAdError) {
String error = String.format("domain: %s, code: %d, message: %s", loadAdError.getDomain(), loadAdError.getCode(), loadAdError.getMessage());
Toast.makeText(main.this, "onAdFailedToLoad() with error: " + error, Toast.LENGTH_SHORT).show();
}
});
When I load my ad in a on function it gives me error "No Ad Config."
Log.d("[Ads]","Ad Load State For on(): " + interstitialAd.isLoaded());
if (interstitialAd.isLoaded())
{
interstitialAd.show();
}

Fixed It and it works.
Found a resource from google. And It cleared all my doubts. For Test Ad Resource Click Me
The Advertisement works in two ways.
While The App Is In Development.
While The App Is In Production.
Scenario 1: While the App Is In Devlopment
For this case, we need to use Test Advertisements. Admob and "com.google.android.gms.ads" doesnt allow user to use Advertisements in Development Phase due to false impressions.
To enable Test Advertisement. There are two ways:
You can either use google ad unit id's which are available on the link adove.
Or
You can use your own ad unit id, but you will be needing to register your device as a test device and use your own request configuration.
Here is a simple Example:
Search for your "Device Id" In "Logcat"
It will look something like
I/ADS: Use Requested Configuration......Arrays.asList("Your device Id will be here");
Then Just Copy Paste This(i can read your mind..)
// Change your Id
RequestConfiguration configuration = new RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("your device id should go here")).build();
MobileAds.setRequestConfiguration(configuration);
Now just load the ad and it will pop up. Congratz. :)
Scenario 2: While the App Is In Production
This is pretty simple part...
Just remove the .setTestDeviceIds(Arrays.asList("your device id should go here")) part from the code...
Link your AdMob App to PlayStore. [Is your app published? Yes...yes...and on...]
Just opt for ad.
And check if Ads are enabled in your app settings on play console.
It should work now. Congratz.

My mistake: Setting test devices and loading test ads at the same time
Solution: Use one only. By using the test devices with production ad unit id's the error disappeared. Ads are loading again and they are test ads even if you specify the production ad unit id

This is another method which doesnt require programming.
Go to Admob dashboard > Settings > Test device > Add test device
To find this go to your device settings > Google > Ads > in that you can find your advertising id!

This also could happen if your app is uploaded to some store and you didn't set your app-ads.txt correctly.
You should bear in mind that if you are using AdMob test ads, you should add this entry into your app-ads.txt too:
google.com, pub-3940256099942544, DIRECT, f08c47fec0942fa0
Soure: https://developers.google.com/admob/android/test-ads

For FLUTTER apps, using google_mobile_ads there is a slight difference in setting test device. According to documentation you have to updateRequestConfiguration. Sample code below:
MobileAds.instance.updateRequestConfiguration(RequestConfiguration(testDeviceIds: ["yourdeviceId"]));
You can get the test device by searching for RequestConfiguration in the run output logs.

For me, This happens in a development phase, I am using .aab not .apk which Google will re-sign it using their Keystore, hence using my own Keystore will return "Error Code 3, No Ads Config".

For Live PlayStore App
Check if Ads are enabled in your app settings on the play console.

I am using flutter.
I just added my device in Admob test devices and it worked.
In production I will only remove the test device.
Let me know if I am wrong.

In my case I forgot to change the app ID for ironsource after I switched from iOS to Android so it kept calling the iOS version of ironsource which was configured to call the wrong Admob ad unit IDs. After fixing the ironsource ID, the correct Admob unit IDs were called and the error was fixed.

My app was already in production and I wanted to add ads in a new update and I faced the same problem. The solution if anyone is having the same issue is to load a test ad unit id instead of your production ad unit id. Once the app is ready and tested, simply replace the test ad unit id with your production one before publishing the app bundle to Google Play console.

Recently , i face same issue, resolved this problem.
Step1 - Please check your test ads running.
Step2 - Signin your app with your .jks file(which is previously used in old version of your app).
Thanks

This warning is nothing more than a sign that your AdMob Account has not yet received a bank confirmation or bank account addition confirmation.

Related

MSAL.Net and Xamarin.Forms having problem with redirect url

I am following this guide https://github.com/Azure-Samples/active-directory-xamarin-native-v2/tree/master/1-Basic
and have this code in my app.xaml.cs
public App()
{
PCA = PublicClientApplicationBuilder.Create(applicationClientId)
.WithTenantId("tenantidhere")
.WithRedirectUri($"msal{applicationClientId}://auth")
.WithIosKeychainSecurityGroup("com.microsoft.adalcache") // focussing on android first so ignore this one
.Build();
//...
}
I get the message that there is something wrong with the return url... and the continue button does not seem to work. I don't know if the issues are related or sepearate.
Here are my azure settings in the azure AD:
I felt that I had to switch back to the 'old experience' because the guides/tutorials etc. does not seem to reflect the current Azure UI.
You will have updated the value of DataScheme on MsalActivity.cs and AndroidManifest.xml with the correspondent clientId of your application.

Can we use firebase crashlytics for our web application?

I have a web application and I want to track its crashing reports.
Can I use Firebase crashlytics or Fabric for this purpose. In their site its mentioned its only for Android or ios.
Regards,
Makrand
There is feature request: https://github.com/firebase/firebase-js-sdk/issues/710
Looks like it's not supported at all, fabric didn't supported crashlytics on web either so it looks like there are maybe some alternatives like https://www.bugsnag.com but I would like to have it too in one place. Don't see difference between web, android or iOS clients at all, don't know why this is not supported.
But for some possible solution for Vue framework is to catch errors and send it to google analytics where you can connect also your firebase mobile apps. I think to try it this way for now. I didnt tested it yet so don't know if I have to catch window errors too.
Vue.config.errorHandler = function (error) {
//Toast.error(error.message)
console.warn(error.message)
//send error as event to google analytcs...
if (error) message = error.stack;
ga('send', 'event', 'Vue.config.errorHandler', message, navigator.userAgent);
}
window.onerror = function(message, source, lineno, colno, error) {
// maybe we need to also catch errors here and send to GA
}
But I found something like this too for typescript https://github.com/enkot/catch-decorator
While there is still no firebase crashlytics for web, google offers Stackdriver with error reporting functionality - it keeps track of all errors with ability to mark them as resolved (it can also send email notifications about new errors):
You can access it using the below url (make sure to put your firebase {project_id} in the link before clicking it):
https://console.cloud.google.com/errors?project={project_id}
There are two ways on how to use it:
Easy way, limited flexibility.
Every console.error(new Error(...)) reported from your firebase function is automatically tracked in the Stackdriver error logging platform.
So you just need to send an error report from your web app to your firebase function and log it using console.error inside that function.
Note, only an instances of Error object will be sent to the Stackdriver platform. For example console.error("{field1: 'text'}") won't be sent to Stackdriver. More info on that in this doc
More comprehensive way that provides an additional control (you can also report userId, your custom platform name, it's version, user agent, etc):
Here is a quick snippet on how it can be used (in our case we first send the error log from web app to our server and then report the error to Stackdriver):
in firebase nodejs:
const {ErrorReporting} = require('#google-cloud/error-reporting');
let serviceAccount = {...} //service account is your firebase credetials that holds your secret keys etc. See below for more details.
let config = {
projectId: serviceAccount.project_id,
reportMode: "always",
credentials: serviceAccount
}
let errors = new ErrorReporting(config);
Report error to Stackdriver from nodejs:
async function reportError(message){
//message is a string that contains the error name with an optional
//stacktrace as a string representing each stack frame separated using "\n".
//For example:
//message = "Error: Oh-hoh\n at MyClass.myMethod (filename.js:12:23)\n etc.etc."
const errorEvent = this.errors.event()
.setMessage(message)
.setUser(userId)
.setServiceContext("web-app", "1.0.0")
await errors.report(errorEvent)
}
More info about the Stackdriver library is available in this doc. And more info about the stacktrace and it's format can be found in the docs here
A few notes on setting it up:
You need to enable two things:
Enable Stackdrive api for your project using the link below (make sure to set your firebase {project_id} in the url below before clicking it)
https://console.developers.google.com/apis/library/clouderrorreporting.googleapis.com?project={project_id}
Make sure to also grant "Error writer" permission to the firebase service account so Stackdriver can receive the error logs (service account is a sort of representation of a "user" for your firebase project who accesses the services)
To grant the premission, follow the below steps:
first locate the "Firebase service account" using your firebase dashboard link (you can find it below) and remember it's value - it looks something like firebase-adminsdk-{random_symbols}#{project_id}.iam.gserviceaccount.com
Then open gcloud console under "Access"->"IAM". Or use the following link:
https://console.cloud.google.com/access/iam?project={project_id} <- put your firebase project id here
Locate your Firebase service account from the step 1.
Press edit for that account and add "Errors writer" permission:
Where to find the serviceAccount.json:
Regarding the serviceAccount - this is a universal credentials that can be used to authenticate many google services including the Stackdriver. You can obtain yours from your firebase dashboard using the url below (just put your firebase project_id in the link before using it):
https://console.firebase.google.com/u/0/project/{project_id}/settings/serviceaccounts/adminsdk
Open it and click "generate new credentials". This will generate a new service account and download the serviceAccount.json that you need to keep safe (you won't be able to get it again unless you generate a new one).
Apparently Sentry now supports several web frameworks out of the box.
I have recently integrated Sentry crashlytics for Django App.
see here:
https://sentry.io/platforms/

Send parameters to Cortana Skill

I created a chatbot which Cortana is using as a skill, it works great, however, I'm currently reading some parameters from a blob storage file and I'd like to make it more dynamic; is there a way to send parameters upon initialization of the skill coming from Cortana? I read here:
Get the user's profile and contextual information
That Cortana can read the UserInfo such as name, email, localization, etc, but I haven't seen any way to enter custom values that I can read once the message is received on init.
I would appreciate your help, thanks!
Don't forget that Cortana is conversational (RESTful, and for the most part stateless). Ask yourself what configuration is part of the dialog, versus what is part of service. If there is configuration that is sent from the user, then it makes sense to store it on the session using one of the three contexts described: user data, conversation data, or private conversation data. This is all botframework: manage state data.
There are a couple ways you can discern if Cortana is configured or not. If you have not stored the properties on userData, assume you are not configured and change your dialog flow. If you want to check at the time you are invoked, you can always do something like this if( session.message.entities[0].name === 'Microsoft.Launch' ) { ... }
In one of my skills, I just do this... if(! session.userData.bookName ) { session.beginDialog('openBook'); return; } where openBook sets the name.
If this is service related, then you can move your configuration where you like. Keeping it in Azure storage may still require a service restart to use changes (unless you continuously poll.) Conversely, you can put the configuration data in system properties (environment variables), either in your web.config or on the container. For example,
<configuration>
<appSettings>
<!-- update these with your BotId, Microsoft App Id and your Microsoft App Password-->
<add key="BotId" value="YourBotId" />
<add key="MicrosoftAppId" value="" />
<add key="MicrosoftAppPassword" value="" /> ...
You can set IIS to watch for changed in the config file to auto-restart.
Hope this helps.

Actions on Google returns in simulator "We're sorry, but something went wrong. Please try again."

Debug tab:
{
"response": "We're sorry, but something went wrong. Please try again.",
"expectUserResponse": false,
"conversationToken": "",
"audioResponse": ""
}
I create the sample project in Dialogflow and it works, but in the simulator Actions on Google it doesn't!
Please read the "Preview the app" section of this page:
https://developers.google.com/actions/dialogflow/first-app?hl=en
To preview your app:
Turn on the following permissions on the Activity controls page for your Google account:
Web & App Activity
Device Information
Voice & Audio Activity
You need to do this to use the Actions Simulator, which lets you test your actions on the web without a hardware device.
Activity control page: https://myactivity.google.com/activitycontrols
Please go to the Actions console and enter the 'Backend services' - it's in the left menu below the 'Simulator'.
There should be one card for Cloud Functions. Does this say, that there's an error? If so, you can find out more in the logs of Firebase Functions, which is linked in this card.
Check the settings and permissions, if you are a developer, owner etc. of the application. I got this fixed by changing the settings...need to dig a little more to understand the exact reason. Will do an update if I understand more

ChromeCast(google cast) can't find app name

ChromeCast (google cast) can't find my app name.
I already registered the app in the whitelist.
I can find and launch apps/YouTube, apps/ChromeCast, apps/OldAppName,
but not apps/NewAppName.
Why so? How can I do any thing?
thanks a lot.
Sincoew
Hi Ali Naddaf,
Thanks you for your reply.
I already checked each step by your link again, My app ID is already in whitelist.
I used "//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"
in my receiver app.
but when I Invoke receiver use new app ID, It's return below Error on receiver source code.
(google default)enter code here
case Message.CODE.ERROR_NET_ABORTED:
return new Message(
Message.getLocaleString('BrainFreeze'),
Message.getLocaleString('Sorry'),
Message.getLocaleString('ActivityAborted'));
On ChromeCast "receiver/1.0/cast_receiver.js",
I can found my app use app ID, such as "192.168.xxx.xxx:8008/apps/AppID",
This rule is still can work???
Thanks a lot.
Sincoew
The error source code is in home screen,
http://192.168.xxx.xxx:9222/devtools/devtools.html?xxxxxx
"message.js" file,
This is ChromeCast default home screen source code
I use below receiver:
//github.com/googlecast/cast-custom-receiver/blob/master/sample_media_receiver.html
sender:
1 //github.com/googlecast/cast-sender-tool-chrome
2 our iOS app sender, (google sample)
ps. default app is normal work, YouTube/ChromeCast/old app-ID(version 1.0 js)
and I can found below page use browser,
"192.168.xxx.xxx:8008/apps/YouTube"
"192.168.xxx.xxx:8008/apps/Chromecast"
"192.168.xxx.xxx:8008/apps/old app-ID"
but can't found
"192.168.xxx.xxx:8008/apps/new app-ID"
Thanks a lot,
Sincoew
Most likely your device is not whitelisted. You need to register your chromecast device for your appid and then, follow the instructions in this post to troubleshoot. Also read the development site for chromecast; it has valuable info.

Resources