Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Data Privacy Opt-Out callback

Discussion in 'Unity Analytics' started by Leonid, Aug 5, 2020.

  1. Leonid

    Leonid

    Joined:
    Aug 20, 2013
    Posts:
    90
    Hello!
    I've recently updated one of my project to 2019.4.6.f1. On previous version I've used a standalone DataPrivacy plugin, and it has an opt-out callback. So I could do something when the user decides to opt out.
    In new versions have DataPrivacy plug-in integrated in Analytics, and it seems there is no callbacks available now.
    So, is there any way to "catch" an user opt-out event now?
    Thanks!
     
    Last edited: Aug 5, 2020
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you share the code that you were using previously?
     
  3. Leonid

    Leonid

    Joined:
    Aug 20, 2013
    Posts:
    90
    It is the code of the plugin, with no modifications.
    https://assetstore.unity.com/packages/add-ons/services/unity-data-privacy-plug-in-118922
    Class DataPrivacy, you can pass a callback method to the FetchOptOutStatusCoroutine.
    This coroutine can be called when the user returns to the application from the browser:

    Code (CSharp):
    1. void OnApplicationFocus(bool hasFocus)
    2. {
    3.     if (hasFocus)
    4.     {
    5.         //Call coroutine, pass callback method.
    6.     }
    7. }
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, what code is now missing? The code that you posted would not be expected to do anything, sorry if I'm missing your point. Can you share your current code that is no longer working? Perhaps it's just a documentation issue?
     
    Leonid likes this.
  5. Leonid

    Leonid

    Joined:
    Aug 20, 2013
    Posts:
    90
    Hello Jeff! Thank you for your replies! Yep, I really feel like I haven't been able to make my point clear.
    Let me ask this question the other way then.
    Is there any way to fetch opt-out status with built-in data privacy plugin?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Nothing should have changed in this regard between versions, to my knowledge. I'm checking with the team here.
     
    Last edited: Aug 7, 2020
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  8. Leonid

    Leonid

    Joined:
    Aug 20, 2013
    Posts:
    90
    That's right, there is no such public method in the built-in DataPrivacy class.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, I'm trying to find out more information, I'll update this thread when I hear more.
     
    Leonid likes this.
  10. Leonid

    Leonid

    Joined:
    Aug 20, 2013
    Posts:
    90
    I'm kind of stuck on this issue.. Can you please tell me if you managed to find a solution?
    Thanks!
     
  11. Leonid

    Leonid

    Joined:
    Aug 20, 2013
    Posts:
    90
    Hello Jeff!
    Any updates on this one?
    Thanks!
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry no, I don't expect any updates soon.