Search Unity

Question iOS 16 - SwiftUI - Error : Can't show a new ad unit when privacy consent dialog is already open

Discussion in 'Unity Ads & User Acquisition' started by MarinaDSF, May 29, 2023.

Thread Status:
Not open for further replies.
  1. MarinaDSF

    MarinaDSF

    Joined:
    May 28, 2023
    Posts:
    3
    Hi,
    I experiment for the first time SwifUI and UnityAds, and I have a problem. I'm sure I did something wrong, and I hope you will help me to understand and solve my issue.
    My reward ad worked fine but after implementing AppTrackingTransparency, I face some error.
    • When I launch the app, I prompt the authorization dialog --> OK
    • If I refuse the tracking, I can display my reward ad when I need to display it, I think that is okay too, if I well understand, the ad is display but there is no tracking.
    • If I accept the tracking, I don't have my reward ad display but I have the RGDP dialog, it seems to be ok but when I accept the cookie consent dialog, I expect my reward ad to display, but it doesn't.
    I have this error message :
    E/UnityAds: +[USRVApiSdk WebViewExposed_logError:callback:] (line:63) :: Show invocation failed: Can't show a new ad unit when privacy consent dialog is already open
    If I close the app and relaunch it, I don't have the authorization dialog as expected and everything works fine.

    Thank you :)
     

    Attached Files:

  2. MarinaDSF

    MarinaDSF

    Joined:
    May 28, 2023
    Posts:
    3
    I'm a little tired but I found a solution. But i'm not sure that's a good solution.
    I had these lines before UnityAds.show(...)
    Code (csharp):
    1. func showUnityAds(_ viewController: UIViewController, _ placementId: String) {
    2.         let gdprConsentMetaData = UADSMetaData()
    3.         gdprConsentMetaData.set("gdpr.consent", value: true)
    4.         gdprConsentMetaData.commit()
    5.         UnityAds.show(viewController, placementId: placementId, showDelegate: self)
    6.     }
    7.  
    I didn't see the RGDP dialog, the reward ad show.
    Is it the right way ?

    Thx for your help
     
  3. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    If you pass us gdprConsentMetaData then the Unity's built-in solution dialog won't show up. You can see more information here: https://docs.unity.com/ads/en/manual/GDPRCompliance
    It looks like your app is having trouble showing ads after the built-in dialog is shown, it would be great if you could contact us and provide a reproducible sample project and device logs.
     
  4. MarinaDSF

    MarinaDSF

    Joined:
    May 28, 2023
    Posts:
    3
    Thank you @SamOYUnity3D, you understood my problem perfectly. And Yes I already read the page, that why I said that I'm not sure about this solution, because, in my opinion it's not ^^
    I will open a ticket about that.
     
    SamOYUnity3D likes this.
Thread Status:
Not open for further replies.