Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        var accepted = PlayerPrefs.GetInt(policyKey, 0) == 1;

        if (accepted)
        {
            return;
        }

        SimpleGDPR.ShowDialog(new TermsOfServiceDialog().
                              SetTermsOfServiceLink("https://unity3d.com/legal/terms-of-service").
                              SetPrivacyPolicyLink("https://unity3d.com/legal/privacy-policy"),
                              onMenuClosed);
    }
Example #2
0
    void Start()
    {
        bool acceptedBefore = PlayerPrefs.GetInt(PolicyKey, 0) == 1;

        if (acceptedBefore)
        {
            Accepted?.Invoke();
            return;
        }

        SimpleGDPR.ShowDialog(new TermsOfServiceDialog().
                              SetPrivacyPolicyLink("https://helltraversers.wordpress.com/privacy-policy/").
                              SetTermsOfServiceLink("https://helltraversers.wordpress.com/terms-conditions/"),
                              OnMenuClosed);
    }
Example #3
0
    /**
     * Async show GDPR consent and wait for user response
     * We are using UnitySimpleGDPRConsent open source package for faster display
     * @see: https://github.com/yasirkula/UnitySimpleGDPRConsent
     */
    private IEnumerator AskForConsentAndInit()
    {
        // Show a consent dialog with two sections (and wait for the dialog to be closed):
        yield return(SimpleGDPR.WaitForDialog(new GDPRConsentDialog().
                                              AddSectionWithToggle(ADS_PERSONALIZATION_CONSENT, "Ads Personalization", "When enabled, you'll see ads that are more relevant to you. Otherwise, you will still receive ads, but they will no longer be tailored toward you.").
                                              AddPrivacyPolicies("https://policies.google.com/privacy", "https://unity3d.com/legal/privacy-policy", "https://my.policy.url")));

        // Check if user has granted the Ads Personalization permission before closing the dialog
        if (SimpleGDPR.GetConsentState(ADS_PERSONALIZATION_CONSENT) == SimpleGDPR.ConsentState.Yes)
        {
            // User accepted
            VoodooSauce.Initialize("f4280fh0318rf0h2", true);

            VoodooSauce.StartGame();
        }
        else
        {
            // User denied
            VoodooSauce.Initialize("f4280fh0318rf0h2", false);

            VoodooSauce.StartGame();
        }
    }
 public void OnPointerClick(PointerEventData eventData)
 {
     SimpleGDPR.OpenURL(url);
 }