Open robertnicjoo opened 4 years ago
Nobody?
To try if it works, set isTesting: true
and use a debug build, so an ad should always be displayed.
Also, listen on admob events to be sure you are not missing anything:
document.addEventListener('admob.interstitial.events.LOAD', function(data){ console.log('admob.interstitial.events.LOAD', data); });
document.addEventListener('admob.interstitial.events.LOAD_FAIL', function(data){ console.log('admob.interstitial.events.LOAD_FAIL', data); });
document.addEventListener('admob.interstitial.events.OPEN', function(data){ console.log('admob.interstitial.events.OPEN', data); });
document.addEventListener('admob.interstitial.events.CLOSE', function(data){ console.log('admob.interstitial.events.CLOSE', data); });
document.addEventListener('admob.banner.events.LOAD', function(data){ console.log('admob.banner.events.LOAD', data); });
document.addEventListener('admob.banner.events.LOAD_FAIL', function(data){ console.log('admob.banner.events.LOAD_FAIL', data); });
document.addEventListener('admob.banner.events.OPEN', function(data){ console.log('admob.banner.events.OPEN', data); });
document.addEventListener('admob.banner.events.CLOSE', function(data){ console.log('admob.banner.events.CLOSE', data); });
@tominou where do i place this codes?
I am not familiar with ionic, but you should put it in your main file, somewhere it will be executed only once.
thanks, i keep trying
@tominou this is what i get:
admob.banner.events.LOAD_FAIL
Event {isTrusted: false, error: 0, reason: "Internal error", adType: "banner", type: "admob.banner.events.LOAD_FAIL", …}
adType: "banner"
bubbles: false
cancelBubble: false
cancelable: false
composed: false
currentTarget: null
defaultPrevented: false
error: 0
eventPhase: 0
isTrusted: false
path: (2) [document, Window]
reason: "Internal error"
returnValue: true
srcElement: document
target: document
timeStamp: 222712.69999997457
type: "admob.banner.events.LOAD_FAIL"
__proto__: Event
Can you show me the content of platform/android/project.properties
and platform/android/app/src/main/AndroidManifest.xml
@tominou
project.properties
# This file was originally created by the Android Tools, but is now
# used by cordova-android to manage the state of the various third party
# libraries used in your application
# This is the Library Module that contains the Cordova Library, this is not
# required when using an AAR
# This is the application project. This is only required for Android Studio Gradle projects
# Project target.
target=android-28
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.google.android.gms:play-services-base:11.0.4
cordova.system.library.2=com.google.android.gms:play-services-ads:11.0.4
cordova.system.library.3=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.system.library.4=com.android.support:support-annotations:27.+
cordova.system.library.5=com.android.support:support-v4:24.1.1+
cordova.system.library.6=com.onesignal:OneSignal:3.10.8
cordova.gradle.include.1=onesignal-cordova-plugin/studio-build-extras-onesignal.gradle
AndroidManifest.xml
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="112" android:versionName="0.1.12" package="com.XXXX.XXXX" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:name="com.google.android.gms.ads.AdActivity" android:theme="@android:style/Theme.Translucent" />
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-7831025766780177~9989918044" />
<receiver android:enabled="true" android:name="nl.xservices.plugins.ShareChooserPendingIntent">
<intent-filter>
<action android:name="android.intent.action.SEND" />
</intent-filter>
</receiver>
<provider android:authorities="${applicationId}.sharing.provider" android:exported="false" android:grantUriPermissions="true" android:name="nl.xservices.plugins.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/sharing_paths" />
</provider>
<amazon:enable-feature android:name="com.amazon.device.messaging" android:required="false" xmlns:amazon="http://schemas.amazon.com/apk/res/android" />
<service android:exported="false" android:name="com.onesignal.ADMMessageHandler" />
<receiver android:name="com.onesignal.ADMMessageHandler$Receiver" android:permission="com.amazon.device.messaging.permission.SEND">
<intent-filter>
<action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
<action android:name="com.amazon.device.messaging.intent.RECEIVE" />
<category android:name="com.XXXX.XXXX" />
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
<permission android:name="com.XXXX.XXXX.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.XXXX.XXXX.permission.RECEIVE_ADM_MESSAGE" />
</manifest>
@tominou Are you there bro?
👆 👀
@tominou please help?!
@robertnicjoo try test your app on another device.
I am trying to get Admob in my app, I get console log success message but no ad showing in my app.
This is what I have:
app.module
posts.page.ts
Any idea what could be wrong?