capacitor-community / admob

Community plugin for using Google AdMob
MIT License
205 stars 66 forks source link

"Consent dismiss error" message in XCode when giving consent on iOS #275

Closed basvdijk closed 10 months ago

basvdijk commented 10 months ago

Describe the bug

In 5.1.0 on iOS the plugin gives an error after giving consent. As a result no ads are shown. On Android there does not seem to be a problem.

The popup shows as intended image

When pressing consent the error shows in the XCode console

ERROR MESSAGE:  {"errorMessage":"Consent dismiss error","message":"Consent dismiss error"}
⚡️  [error] - {"errorMessage":"Consent dismiss error","message":"Consent dismiss error"}
⚡️  [error] - ERROR Error: Uncaught (in promise): Error: Consent dismiss error

after enabling debugging:

⚡️  TO JS {"isConsentFormAvailable":true,"status":"OBTAINED"}
2023-08-29 20:49:57.252873+0200 App[4128:1184885] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
2023-08-29 20:49:57.252973+0200 App[4128:1184885] [ProcessSuspension] 0x10f084120 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=4134, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
2023-08-29 20:49:57.255894+0200 App[4128:1184885] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
2023-08-29 20:49:57.255934+0200 App[4128:1184885] [ProcessSuspension] 0x10f084180 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess Suspended Assertion' for process with PID=4134, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
2023-08-29 20:50:16.312193+0200 App[4128:1184192] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

To Reproduce

Expected behavior Nothing, I expect that the consent is stored and ads are shown

Desktop (please complete the following information):

Smartphone (please complete the following information):

rdlabo commented 10 months ago

@basvdijk fixed, and released v5.1.1. Please try! https://github.com/capacitor-community/admob/releases/tag/v5.1.1

basvdijk commented 10 months ago

@rdlabo Thansk! This seems to solve it. Unfortunately another iOS error popped up for which I've created a new bug report at https://github.com/capacitor-community/admob/issues/276

rangloe commented 4 months ago

@basvdijk I had the same problem, and I solved it by first calling the reset method:

try {
 await AdMob.resetConsentInfo();
 await AdMob.requestConsentInfo();
 await AdMob.showConsentForm();
} catch (error) {
 console.error('Error during consent process:', error);
} finally {}