I have implemented the ads in my game which is in the development phase using AdMob service. The test ads are working perfectly fine but when I tried implementing with real ads it's not working. Even I got the mail from AdMob issuing that "You are showing ads". The ads requests are also showing 500+ but in the real device, ads are not displaying. Its been like 6 hours I implemented them ads in my app and more than a month I created the ads on AdMob. Is it the problem with app publishing? Do the ads displays only once the app is published on the app store?
2 Answers
You need to see what is the error code which your AdMob callbacks are returning. If the error code is 3, this means that the error message is No fill. This in turn means that you have made a successful request to the AdMob network, however, they were not able to fill in your request. Whether the network would be able to fill in an ad request usually depends on a number of factors - one of the main ones being your location, speaking from personal experience. So once you upload your app on the store and people from different parts of the world start downloading it you should start seeing impressions coming in.
I had the same problem with my flashlight app. I tried a lot of things but nothing worked, test ads were working fine but my real ads worked for a couple of days and then suddenly stopped. There was no suspension or anything like that so I tried to contact google AdMob, but no useful info was provided from them. I was desperate and i wanted to ditch the google ads and try different ad networks. Then by a lucky chance, i contacted a developer who helped me with this issue. The problem was in the addition of two permissions Internet and Access Network State to the manifest file of my project. When i added this, ads started to show on my device only, but not on other devices. I also needed to define my ad activity in the manifest file and properly implement my banner ad at the bottom of my constraint layout. Only after that everything worked fine. So sometimes the problem can be in the implementation itself.
Add these permissions and activity to the manifest(if they are not already present):
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout
|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent"/>
If you are using constraint layout and banner ad, add this to your XML layout file and adjust the position of this AdView to your liking(bottom or top of the layout) and replace test ad unit id with your real id.
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
</com.google.android.gms.ads.AdView>
It's important that you don't forget to add
xmlns:ads="http://schemas.android.com/apk/res-auto"
attribute for the AdView.
With these changes update the version of your app on Play Store. it worked for me.