Coder Social home page Coder Social logo

gdprdialog's Introduction

DEPRECATED (REPLACED BY A NEW LIBRARY)

This library is deprecated in favour of my MaterialDialogs library - it's a very modularised library so switching to it won't add a lot of unnecessary overload if you don't want it.

Switching is easy, because I've based the GDPR Dialog module completely on this library, so after switching to new library the new library will reuse the settings from this library automatically (it will reuse any already given consent)

Read the readme(s) over there if you want a full insight, but here's a short example how it works after switching:

Side Note:

  • after switching, you do not need to implement any interface in an activity anymore - the dialogs use a more convenient alternative solution.
  • the other dialog uses material 3 theme
  • all the benefits of the other dialog library which can be found inside its readme

Usage:

1) create a setup

// nearly a kotlin based copy of the GDPRSetup from this library
val setup = GDPRSetup(
    networks = listOf(GDPRDefinitions.ADMOB),
    policyLink = "https://www.policy.com",
    //explicitAgeConfirmation = true,
    //hasPaidVersion = true,
    //allowNoConsent = true,
    explicitNonPersonalisedConfirmation = true
    // ...
)

2) ask for consent if necessary

val shouldAskForConsent = GDPR.shouldAskForConsent(activity, setup)
if (shouldAskForConsent) {
    DialogGDPR(
    	1100, // some id for identification
    	setup = setup
    )
        .showDialogFragment(activity)
}

3) handle the dialog result

The ID parameter is optional, you can listen to ALL events of a specific type as well, but check out the other library for more details.

// handle ALL events
onMaterialDialogEvent<DialogGDPR.Event>(id = 1100) { event ->
    // handle the event including cancels...
}
// handle specific state event only
onMaterialDialogEvent<DialogGDPR.Event.Result>(id = 1100) { event ->
    // handle successful events only...
	val state = event.consent
}

4) query consent if needed

val currentConsent = GDPR.getCurrentConsentState(this, setup)
val canCollectPersonalInformation = GDPR.canCollectPersonalInformation(this, setup)

README

Check out the old readme of this repository here: README

gdprdialog's People

Contributors

1951fdg avatar digipom avatar ferreirajoao avatar foreza avatar ivfit avatar kubastick avatar luklek avatar mflisar avatar mmarco94 avatar ocos avatar sphrak avatar thubalek avatar yshrsmz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdprdialog's Issues

Please make consent states clear

Will the callback ever return UNKNOWN or NO_CONSENT GDPRConsent states? What can be done if it returns that?
I was confused separating stuff in the callback, when I came across this: https://github.com/MFlisar/GDPRDialog/blob/master/library/src/main/java/com/michaelflisar/gdprdialog/GDPRConsent.java

And is there anyway with which it can be immediately decided whether to show or not the 'Withdraw consent' button in the onCreate of a settingsActivity? If the user has not been shown the dialog box ever in the past due to being outside EEA, he shan't be shown the button.

How to check if the library is initialized

Hello, how do I know if the library is already initialized?

If is not GDPR.getInstance().getConsentState().getConsent() cause a crash, and I want do to if the library is initialized launch this code, else initialize the library and after launch the code.

I did something like this but maybe there is a better way:

private static boolean GDPR_initialized = false;

 if (!GDPR_initialized){
            GDPR.getInstance().init(activity);
            GDPR_initialized = true;
        }

Slovak Implementation

`

<!-- Dialog - MAIN PAGE TEXTS -->
<!-- ************************ -->

<string name="gdpr_dialog_text1_part1">Záleží nám na vašom súkromia a bezpečnosti vašich dát.</string>
<string name="gdpr_dialog_text1_part2">Aby tako aplikácie mohla byť poskytovaná %1$s, potrebuje používať služby ďalších firiem.</string>
<string name="gdpr_dialog_text2_singular">V tejto aplikácii používame %1$s. Táto služba (a jej partneri) zbiera unikátny identifikátory a ďalšie osobné údaje. Vašu voľbu môžete kedykoľvek zmeniť v nastaveniach aplikácie. &lt;a href=\"\">Tu dozviete viac o tejto službe a tom, ako spracováva osobné dáta&lt;/a>.</string>
<string name="gdpr_dialog_text2_plural">V tejto aplikácii používame %1$s. Tieto služby (a ich partneri) zbierajú unikátny identifikátory a ďalšie osobné údaje. Vašu voľbu môžete kedykoľvek zmeniť v nastaveniach aplikácie. &lt;a href=\"\">Tu dozviete viac o týchto službách a tom, ako spracúvajú osobné údaje&lt;/a>.</string>
<string name="gdpr_dialog_text3">Svoju voľbu môžete kedykoľvek zmeniť v nastaveniach aplikácie.</string>
<string name="gdpr_dialog_question">Môžeme pokračovať v použití dát pre tieto účely%1$s?</string>
<string name="gdpr_dialog_question_ads_info">\u0020 a rovnako tak aj pre zobrazenie prispôsobených reklám</string>

<!-- *********************** -->
<!-- Dialog - SUB PAGE TEXTS -->
<!-- *********************** -->

<string name="gdpr_dialog_text_info1">V aplikácii používame tieto knižnice tretích strán:</string>
<string name="gdpr_dialog_text_info3">Kliknutím na názov služby sa pozriete na jej zásady ochrany osobných údajov%1$s</string>
<string name="gdpr_dialog_text_info3_privacy_policy_part">\u0020a kliknutím na tento link zistíte &lt;a href=\"%1$s\">naše zásady ochrany osobných údajov&lt;/a>.</string>
<string name="gdpr_dialog_text_explicit_non_personalised_info1">Nebudeme zbierať osobné dáta pre reklamy ušité priamo vám na mieru.Aj keď nie sú reklamy zacielené priamo na vás osobne (čiže nepoužívajú osobné reklamné identifikátory), stále používajú identifikáciu mobilného zariadenia pre to, aby vám nezobrazovali stále rovnaké reklamy, pre reportovanie a tiež pre boj proti zneužitiu reklamných systémov.</string>

<!-- ******************************** -->
<!-- Dialog - BUTTONS AND SHORT INFOS -->
<!-- ******************************** -->

<string name="gdpr_dialog_title">Súhlas ohľadom GDPR</string>
<string name="gdpr_dialog_confirm_age">Týmto potvrdzujem, že je mi najmenej 16 rokov.</string>
<string name="gdpr_dialog_agree">Áno, súhlasím</string>
<string name="gdpr_dialog_disagree_no_thanks">Nie, ďakujem</string>
<string name="gdpr_dialog_disagree_buy_app">Nie, ďakujem, radšej kúpim platenú verziu</string>
<string name="gdpr_dialog_close">Zavrieť</string>
<string name="gdpr_dialog_back">Späť</string>
<string name="gdpr_dialog_disagree_no_ads">Prosím, vôbec žiadne reklamy</string>
<string name="gdpr_dialog_disagree_info">Beriem na vedomie, že stále uvidím reklamy, len pravdepodobne nebudú zodpovedať tomu, čo by ma mohlo zaujímať.</string>
<string name="gdpr_last_list_seperator">\u00A0a\u00A0</string>
<string name="gdpr_buy_app">Zakúpiť aplikáciu</string>
<string name="gdpr_withdraw_consent">Zrušiť GDPR súhlas</string>
<string name="gdpr_age_not_confirmed">Než budeme pokračovať, prosím, potvrďte svoj vek</string>
<string name="gdpr_free">zadarmo</string>
<string name="gdpr_cheap">za dobrú cenu</string>
<string name="gdpr_show_me_partners">Zobraziť partnermi</string>

<!-- ************** -->
<!-- Networks types -->
<!-- ************** -->

<string name="gdpr_type_ads">reklamy</string>
<string name="gdpr_type_cloud_database">cloudové databázy</string>
<string name="gdpr_type_crash">nástroje analýzy pádov aplikácií</string>
<string name="gdpr_type_analytics">nástroje analýzy správania</string>

`

Plurals should be used in slightly different way.

I tried to translate your string to Czech but there is a problem.

In Czech we have not only different word for plural and singular (and singulars dependent on number of items) but we have also different words depending where in the sentence they are.

I was quite a creative but I can't anyhow handle this situation:

gdpr preklad

this is translation of the word Service (in Czech služba singular, služby plural). But there is necessary to have this word either in form služba/služby in first occurrence and službě/službám in second occurence.

I would suggest not to try include plurals into strings but to put whole sentences into plurals.xml file.
It is more flexible and I'm sure it will also work better in other languages.

Feature Request: Allow us to overwrite text!

I have an in-app-purchase that removes Ad's - I would still like to use this Dialog to get approval to use things like Firebase and Crashlytics, it would be great if I could overwrite the subtext under 'No, Thank You" to say something else based on the context of the application.

Clipped text

Using the bottom dialog layout in italian on a 1920x1080 screen (320dp width), the text is partially clipped.

Not a major issue, but I think fixing it will be easy.

Crash

I keep getting crashes like this:
java.lang.IllegalStateException: at android.support.v4.app.FragmentManagerImpl.enqueueAction (SourceFile:2087) at android.support.v4.app.BackStackRecord.commitInternal (SourceFile:678) at android.support.v4.app.BackStackRecord.commit (SourceFile:632) at android.support.v4.app.DialogFragment.show (SourceFile:143) at com.michaelflisar.gdprdialog.GDPR.showDialog (SourceFile:167)

The issue seems to appear on Samsung Galaxy J7 and J5.

Alignment of texts

Would it be possible somehow make alignment of texts more consistent? See

image

What do you think?

This is not critical, just a feedback. I'm OK if you close it with WONTFIX.

AdMob Privacy Policy and Ad techonolgy providers (some ideas about the Info Page)

When AdMob is setup, it should display something like AdMob (and its Ad techonolgy providers, marked with * in the linked page). [I know my wording kind of sucks]
Click on AdMob would open the AdMob Privacy Policy (which I am not even sure it exists... it could be the new generic Google Policy where it also explains about data and personalized ads).
Click on Ad techonolgy providers would open the current link with list of providers.

The main reason behind my idea is that the current Link isn't really the AdMob Privacy Policy at all. And most of all we should find a way to explain that the providers Our App is using are those marked with a * in the list. (this second part being more important for me... can skip the link to AdMob policy I guess)

Another way could be to integrate the Google Consent SDK just to get a list of the actual AdProviders as setup in our AdMob account.
List<AdProvider> adProviders = ConsentInformation.getInstance(context).getAdProviders();
Then display the list when the user click Ad techonolgy providers in the Info Page.
There is a similar solution posted on Androidev reddit already.

Can't Disable Certain Properties

I have the following setup object in my onCreate method:

        GDPR.getInstance().init(this)
        setup = GDPRSetup(GDPRDefinitions.FIREBASE_CRASH)
                .withShowPaidOrFreeInfoText(false)
                .withExplicitAgeConfirmation(false)
                .withShortQuestion(false)

I later show the dialog like this when a button is clicked:

GDPR.getInstance().showDialog(this, setup, GDPRLocation.UNDEFINED)

However, the "Can we continue to use your data for these purposes?" and "By agreeing, you are confirming that you are over the age of 16." messages are still showing.

min sdk 15?

Could you add support of min 15 sdk please?
It looks like there is no need to force for 16 min

FR localization

Hey, this isn't actually an issue, I'm just too lazy to clone and do a pull request, so here's the French localization for you to add:

  <string name="gdpr_age_not_confirmed">Merci de confirmer votre âge avant de continuer</string>
  <string name="gdpr_buy_app">Acheter l\'application</string>
  <string name="gdpr_cheap">abordable</string>
  <string name="gdpr_dialog_agree">Oui, je suis d\'accord</string>
  <string name="gdpr_dialog_back">Retour</string>
  <string name="gdpr_dialog_close">Fermer</string>
  <string name="gdpr_dialog_confirm_age">Je confirme avoir au moins 16 ans</string>
  <string name="gdpr_dialog_disagree_buy_app">Non merci, je veux acheter cette application</string>
  <string name="gdpr_dialog_disagree_info">Je comprends qu\'il y ait des publicités, mais elles ne correspondent pas à mes intérêts</string>
  <string name="gdpr_dialog_disagree_no_ads">Aucune publicité s\'il vous plaît</string>
  <string name="gdpr_dialog_disagree_no_thanks">Non, merci</string>
  <string name="gdpr_dialog_question">Pouvons nous continuer à utiliser vos données à ces propos%1$s ?</string>
  <string name="gdpr_dialog_question_ads_info">\u0020ainsi que pour vous proposer des publicités personnalisées</string>
  <string name="gdpr_dialog_text1">Votre intimité et la sécurité de vos données sont primordiaux. Nous gardons cette application %1$s en utilisant des services tiers.</string>
  <string name="gdpr_dialog_text2_plural">Dans cette application, il y a des publicités. Ces services (y compris leurs partenaires) collectent les identifiants ainsi que d\'autres informations personnelles. Vous pouvez changer votre choix à tout moment dans les paramètres de l\'application. &lt;a href=\"\">En savoir plus sur ces services et vos données personnelles.&lt;/a>.</string>
  <string name="gdpr_dialog_text2_singular">Dans cette application, il y a des publicités. Ce service (y compris ses partenaires) collecte les identifiants ainsi que d\'autres informations personnelles. Vous pouvez changer votre choix à tout moment dans les paramètres de l\'application. &lt;a href=\"\">En savoir plus sur ces services et vos données personnelles&lt;/a>.</string>
  <string name="gdpr_dialog_text3">En acceptant, vous confirmez avoir au moins l\'âge de 16 ans.</string>
  <string name="gdpr_dialog_text_explicit_non_personalised_info1">Nous ne collecterons pas vos données pour vous proposer des publicités personnalisées. Bien que les publicités non personnalisées n\'utilisent pas les identifiants d\'annonces pour mobile pour le ciblage des publicités, elles les utilisent tout de même pour le plafonnement des fréquences, les rapports de publicités ainsi que pour la lutte contre la fraude et les abus."</string>
  <string name="gdpr_dialog_text_info1">Dans cette application, nous utilisons les services tiers suivants :</string>
  <string name="gdpr_dialog_text_info3">Cliquez sur un service pour consulter sa politique de confidentialité%1$s.</string>
  <string name="gdpr_dialog_text_info3_privacy_policy_part">\u0020ou cliquez sur suivant pour consulter &lt;a href=\"%1$s\">notre politique de confidentialité&lt;/a></string>
  <string name="gdpr_dialog_title">Consentement à la protection des données</string>
  <string name="gdpr_free">gratuite</string>
  <string name="gdpr_last_list_seperator">\u0020and\u0020</string>
  <string name="gdpr_show_me_partners">Afficher nos partenaires</string>
  <string name="gdpr_type_ads">publicités</string>
  <string name="gdpr_type_analytics">rapport d\'analyse</string>
  <string name="gdpr_type_authorization">authorisation</string>
  <string name="gdpr_type_cloud_database">une base de données dans le cloud</string>
  <string name="gdpr_type_crash">rapport d\'incident</string>
  <string name="gdpr_type_notifications">envoi de notifications</string>
  <string name="gdpr_withdraw_consent">Retirer le consentement à la protection des données</string>

By the way, there are its/it's mistakes in these English keys, please correct them:
gdpr_dialog_text2_singular
gdpr_dialog_text_info3

GDPRLocation (timeout or no internet case)

In case of Timeout or No Internet, the location isn't changed to GDPRLocation.UNKNOWN.
I tested it by changing GDPRConsentState default value to mLocation = GDPRLocation.EAA and it keeps this value after Timeout or No Internet.

Also I was wondering if you could add one more check.
In case of Timeout (maybe reduced to 3000ms) or No Interent, we could define location to be EAA or NOT_IN_EAA by

private enum EUCountry {
        AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE, GB, //28 member states
        GF, PF, TF, //French territories French Guiana,Polynesia,Southern Territories
        EL, UK,  //alternative EU names for GR and GB
        IS, LI, NO, //not EU but in EAA
        CH, //not in EU or EAA but in single market
        AL, BA, MK, XK, ME, RS, TR; //candidate countries



        public static boolean contains(String s) {
            for (EUCountry eucountry : values())
                if (eucountry.name().equalsIgnoreCase(s))
                    return true;
            return false;
        }

    }

    public static boolean isEU(Activity activity) {
        boolean error = false;

        /* is eu sim */
        try {
            final TelephonyManager tm = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE);
            String simCountry = tm.getSimCountryIso();
            if (simCountry != null && simCountry.length() == 2) {
                simCountry = simCountry.toUpperCase();

                if (EUCountry.contains(simCountry)) {
                    Timber.v("is EU User (sim)");
                    return true;
                }
            }
        } catch (Exception e) { error = true; }


        /* is eu network */
        try {
            final TelephonyManager tm = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE);
            if (tm.getPhoneType() != TelephonyManager.PHONE_TYPE_CDMA && tm.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE) {
                String networkCountry = tm.getNetworkCountryIso();
                if (networkCountry != null && networkCountry.length() == 2) {
                    networkCountry = networkCountry.toUpperCase();

                    if (EUCountry.contains(networkCountry)) {
                        Timber.v("is EU User (network)");
                        return true;
                    }
                }
            }
        } catch (Exception e) { error = true; }

        /* is eu time zone id */
        try {
            String tz = TimeZone.getDefault().getID().toLowerCase();
            if (tz.length() < 10) {
                error = true;
            } else if (tz.contains("euro")) {
                Timber.v("is EU User (time)");
                return true;
            }
        } catch (Exception e) {
            error = true;
        }

        return error;
    }

Crash

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.michaelflisar.gdprdialog.GDPRNetwork[] com.michaelflisar.gdprdialog.GDPRSetup.networks()' on a null object reference
        at com.michaelflisar.gdprdialog.helper.GDPRViewManager.<init>(GDPRViewManager.java:72)
        at com.michaelflisar.gdprdialog.GDPRDialog.onCreate(GDPRDialog.java:43)

CheckRequestLocation

Whatever parameter I set, the window is always displayed
mSetup.withCheckRequestLocation(true); //or false
How to make it only visible to EU users

Implements Dialog in Settings

Hello, I want to add the possibility to change the consent settings in my app. There is a way yo call the dialog without implementing the interface?
I tried something like this but it crash:

            GDPR.getInstance().init(getActivity());
            GDPRSetup setup = new GDPRSetup(GDPRDefinitions.ADMOB, GDPRDefinitions.FIREBASE_ANALYTICS);
            GDPR.getInstance().showDialog((AppCompatActivity) getActivity(), setup, GDPR.getInstance().getConsentState().getLocation());

I don't need the callback, and I need to show the dialog when the user press the button, not when it need to be show.

withLoadAdMobNetworks

How exactly should be withLoadAdMobNetworks used?

Is it really necessary to show all AdMob's 200 subproviders?

Keep a function to add custom networks.

I think it's a better idea to keep a function like setup.addCustomNetwork() to add custom networks like answers, crashlytics, or some ad network.
That way someone doesn't need to mess with this project and can add networks (GDPR Definitions) at runtime.

Location fallback using Locale?

Hi,

It might be a good idea to add a fallback method to check the location based on user Locale as a last resort. Putting a bool with true value in each of the language classifiers and false to the default would do it.

What do you think?

Allow to selectively mark services as optional

In v0.5 I remove the ability to selectively accept single services.

Many times you only use services that must be accepted anyways, as the app must be bought otherwise (to remove ads) or can't work anyways (e.g. without the cloud database).

So for many people this should be sufficiant...

Feel free to add this feature again at anytime...

Localytics & Adobe

String localytics = "Localytics";
String localyticsUrl = "https://www.localytics.com/privacy-policy/";
LOCALYTICS_ANALYTICS = new GDPRNetwork(context, localytics, localyticsUrl, R.string.gdpr_type_analytics, false);
LOCALYTICS_MESSAGING = new GDPRNetwork(context, localytics, localyticsUrl, R.string.gdpr_type_notifications, false);

<string name="gdpr_type_authorization">authorization</string>

String adobe = "Adobe";
String adobeUrl = "https://www.adobe.com/privacy/policy.html";
ADOBE_ID = new GDPRNetwork(context, adobe, adobeUrl, R.string.gdpr_type_authorization, false);

"NO, THANK YOU" text bugged showing "NO THANK YOU, I WANT TO BUY THE APP" even when paid version is disabled.

Hi,

I noticed that there is a rather critical bug
No consent button should show text: NO, THANK YOU, but instead it;s always showing NO, THANK YOU, I WANT TO BUY THE APP

This is rather annoying as I don't have paid option, this is how I set my code:|

    GDPR.getInstance().init(this);

     setup = new GDPRSetup(GDPRDefinitions.ADMOB,GDPRDefinitions.APPNEXT,GDPRDefinitions.UNITY) // add all networks you use to the constructor, signature is `GDPRSetup(GDPRNetwork... adNetworks)`
            // everything is optional, but you should at least provide your policy
            .withPrivacyPolicy("https://brprivacypolicyblog.wordpress.com/")
            .withAllowNoConsent(false)
            .withPaidVersion(false)
            .withExplicitAgeConfirmation(false)
            .withCheckRequestLocation(GDPRLocationCheck.DEFAULT) // pass in an array of location check methods, predefined arrays like `DEFAULT` and `DEFAULT_WITH_FALLBACKS` do exists
            .withCheckRequestLocationTimeouts(2000, 2000)
            .withBottomSheet(false)
            .withForceSelection(true)
            .withShortQuestion(true)
            .withLoadAdMobNetworks("pub-3253084521349460") // e.g. "pub-0123456789012345"
            .withNoToolbarTheme(true)

     // show the info that this app is cheap/free based on the networks or hide it
            ;
    //GDPR.getInstance().checkIfNeedsToBeShown(this /* extends AppCompatActivity & GDPR.IGDPRCallback */, setup);

    GDPR.getInstance().showDialog(this, setup, GDPRLocation.IN_EAA_OR_UNKNOWN);

and it's still showing like that.

CZ text typo

istead
 <string name="gdpr_dialog_text2_singular">V této aplikaci používáme %1$s. Tato služba (a její partneři) sbírá unikátní indentifikátory a další osobní data. Vaši volbu můžete kdykoliv změnit v nastavení aplikace. &lt;a href=\"\">Zde dozvíte více o této službě a tom, jak zpracovává osobní data&lt;/a>.</string>

should be
 <string name="gdpr_dialog_text2_singular">V této aplikaci používáme %1$s. Tato služba (a její partneři) sbírá unikátní identifikátory a další osobní data. Vaši volbu můžete kdykoliv změnit v nastavení aplikace. &lt;a href=\"\">Zde dozvíte více o této službě a tom, jak zpracovává osobní data&lt;/a>.</string>

indentifikátory should be: identifikátory

I am czech native speaker.

App crash Invoke-customs are only supported starting with Android O (--min-api 26)

 public void callDamnedGDPR() {
        setup = new GDPRSetup(GDPRDefinitions.ADMOB)
                .withPrivacyPolicy("***")
                .withAllowNoConsent(true)
                .withPaidVersion(true)
                .withExplicitAgeConfirmation(true)
                .withCheckRequestLocation(false)
                .withBottomSheet(true)
                .withForceSelection(true)
                .withShortQuestion(true)
                .withLoadAdMobNetworks("pub-***")
        ;
        GDPR.getInstance().checkIfNeedsToBeShown(this, setup);
    }

    @Override
    public void onConsentNeedsToBeRequested(GDPRPreperationData gdprPreperationData) {
        GDPR.getInstance().showDialog(this, setup, gdprPreperationData.getLocation());
    }

The application falls as soon as I add this line to my code:
GDPR.getInstance().showDialog(this, setup, gdprPreperationData.getLocation());
Error:
Piccy.info - Free Image Hosting

Invoke-customs are only supported starting with Android O (--min-api 26)
Message{kind=ERROR, text=Invoke-customs are only supported starting with Android O (--min-api 26), sources=[Unknown source file], tool name=Optional.of(D8)}

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users*\Desktop***\app\build\intermediates\transforms\androidGradleClassShrinker\debug\15

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.

Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete

Caused by: com.android.tools.r8.utils.AbortException

  • compileSdkVersion 27
  • buildToolsVersion 27.0.3
  • minSdkVersion 14
  • targetSdkVersion 27

Admob and consent SDK.

In the readme there is no clarity if the Consent SDK provided by Google should be used with this GDPR Dialog. Or the consent should be sent directly to PublisherAdRequest of Google Mobile Ads SDK.
Is this project meant to replace Consent SDK or is a 'Publisher-managed consent collection' utility.
I also don't understand how GDPR Dialog obtains EEA location data.

Change text

There is a way to change the text displayed, for example I want to change the text below the button "No, Thanks"

Wrong strings

String text2 = activity.getString(R.string.gdpr_dialog_text_part2, mSetup.explicitAgeConfirmation() ? activity.getString(R.string.gdpr_dialog_text_part2_no_age) : activity.getString(R.string.gdpr_dialog_text_part2_with_age));

gdpr_dialog_text_part2_no_age and gdpr_dialog_text_part2_with_age have a different name in English strings (but it's correct in DE)

Consent wall is not created.

I just noticed that the activity including the ads keep loading in the background while the consent dialogue is shown.
Ideally it should be something like this:
public abstract class MyAppCompatActivity extends AppCompatActivity {
onCreate {
If (consentRequired) {
startActivity(consentActivity);
}
}
I have implemented this in some android app to force users to accept terms.
I am typing on mobile, so please pardon any mistakes.

Add Test Mode

Developers out of european region should be able to see how the dialog will work for testing purposes

Option to change Consent state in App Settings

Do you have any idea, from GDPR point of view. what the title of such setting should be? something like "Edit personal data consent" maybe?

Also I was wondering, when the user click on this option setting, is good idea to reset the Consent Status before showing the dialog again?

Thanks :)

AdMob providers not showing

I just noticed that I can't load the AdMob providers list. It always display the "Show partners" instead of the full list of AdProviders as fetched from my AdMob publisherID.
I tested with the demo app too and it's the same.
Also if I manually opened the url (with my pubID) and the txt includes the full list of "companies", "company_name" and "policy_url".

Am I doing something wrong?

Crash report

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{xxxx.xxxx.xxxxx.xxxx/theme.ui.activity.DemoGDPRActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2419)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2479)
android.app.ActivityThread.-wrap11 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1347)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5420)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)
Caused by java.lang.NullPointerException
Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference
com.michaelflisar.gdprdialog.helper.GDPRViewManager. (GDPRViewManager.java:71)
com.michaelflisar.gdprdialog.GDPRActivity.onCreate (GDPRActivity.java:30)
android.app.Activity.performCreate (Activity.java:6280)
android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1107)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2372)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2479)
android.app.ActivityThread.-wrap11 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1347)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5420)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)

Additional networks

APPODEAL = new GDPRNetwork(context, "Appodeal", "https://www.appodeal.com/privacy-policy", R.string.gdpr_type_ads, true) .withIsIntermediator("https://www.appodeal.com/home/partners-privacy-policies/");

FABRIC_CRASHLYTICS = new GDPRNetwork(context, "Fabric Crashlytics", "https://fabric.io/terms", R.string.gdpr_type_crash, false);

FABRIC_ANSWERS = new GDPRNetwork(context, "Fabric Answers", "https://fabric.io/terms", R.string.gdpr_type_analytics, false);

For notifications:

<string name="gdpr_type_notifications">sending notifications</string>

ONESIGNAL = new GDPRNetwork(context, "OneSignal", "https://onesignal.com/privacy_policy", R.string.gdpr_type_notifications, false);

FIREBASE_CLOUD_MESSAGING = new GDPRNetwork(context, firebase, firebaseUrl, R.string.gdpr_type_notifications, false);

DemoActivity

EDIT: ops, sorry^^
Sorry in case I shouldn't report this (as it's just the demo app)
In the DemoActivity both cases have the same GDPRConsent.PERSONAL_CONSENT

case NON_PERSONAL_CONSENT_ONLY:
Toast.makeText(this, "User accepts NON PERSONAL ads", Toast.LENGTH_LONG).show();
onConsentKnown(consentState == GDPRConsent.PERSONAL_CONSENT);
break;
case PERSONAL_CONSENT:
Toast.makeText(this, "User accepts PERSONAL ads", Toast.LENGTH_LONG).show();
onConsentKnown(consentState == GDPRConsent.PERSONAL_CONSENT);
break;

Slovak typo

<string name="gdpr_show_me_partners">Zobraziť partnerov</string>

is correct.

sorry

Feature: Add more ad networks to increase overall package visibility

Hi,

I was following your library and I'm really enjoying what I'm seeing here.
I just recently joined the adtech industry (junior dev here) and still learning the ropes.

My suggestion (minor) is to add strings / text / links for the other ad networks, like MoPub / Vungle / Unity as those have a pretty healthy following.

No virtual method isStateSaved() crash

java.lang.NoSuchMethodError: No virtual method isStateSaved()Z in class Landroid/support/v4/app/FragmentManager; or its super classes at com.michaelflisar.gdprdialog.GDPR.showDialog(GDPR.java:167)

Targeting SDK 25 and using support lib 25.4.0.

urlConnection Timout values

It would be nice if we could set the setReadTimeout and setConnectTimeout directly.
I am planning to use a very lower value (maybe 2000ms) along with the fallback methods.

Sometime Dialog Activity is created 2 times

Sometime the DemoGDPRActivity.startActivityForResult(this, mSetup, data.getLocation(), DemoGDPRActivity.class, DEMO_GDPR_ACTIVITY_REQUEST_CODE); creates 2 activities on top of each other. After clicking on the first, the second is displayed and need to click again on consent.

Any idea on how I could track/check or reproduce this?

Title of message - free / cheap related text

For my application I'm only using crashalytics / analytics, this is both in the free and paid versions (and both are optional). The current title will imply the app is free or cheap because of this, but if i set it to Paid which allows it to say cheap for my paid apps, it automatically inserts a button to go to the paid version - which I don't want. If I don't include that it says free, when the app may not have been free.

I can't alter the text because because it expects to insert free or cheap via getString.

I modified my own version to just remove that part of the title so it now only has the first sentence:
Original:
We care about your privacy and data security. We keep this app %1$s by using third party services.
My version:
We care about your privacy and data security.

Is there some way to make the second sentence optional?

something wrong with text2 layout

After restoring dialog from savedInstantceState (after clicking on 'Show Partners' or 'Admon') there is something wrong with layout.
image

Definitions grouping

Since some libraries are used for multiple purposes, I think we should group those together in GDPRDefinitions.java, as for Firebase, to avoid mentioning them several times in 'learn more' page.

So instead of:

FLURRY_ANALYTICS = new GDPRNetwork(context, "Flurry Analytics", "https://policies.oath.com/us/en/oath/privacy/index.html", R.string.gdpr_type_analytics, false);
FLURRY_CRASH = new GDPRNetwork(context, "Flurry Crash", "https://policies.oath.com/us/en/oath/privacy/index.html", R.string.gdpr_type_crash, false);
FABRIC_CRASHLYTICS = new GDPRNetwork(context, "Fabric Crashlytics", "https://fabric.io/terms", R.string.gdpr_type_crash, false);
FABRIC_ANSWERS = new GDPRNetwork(context, "Fabric Answers", "https://fabric.io/terms", R.string.gdpr_type_analytics, false);

to have:

String flurry = "Flurry";
String flurryUrl = "https://policies.oath.com/us/en/oath/privacy/index.html";
FLURRY_ANALYTICS = new GDPRNetwork(context, flurry, flurryUrl, R.string.gdpr_type_analytics, false);
FLURRY_CRASH = new GDPRNetwork(context, flurry, flurryUrl, R.string.gdpr_type_crash, false);
String fabric = "Fabric";
String fabricUrl = "https://fabric.io/terms";
FABRIC_CRASHLYTICS = new GDPRNetwork(context, fabric, fabricUrl, R.string.gdpr_type_crash, false);
FABRIC_ANSWERS = new GDPRNetwork(context, fabric, fabricUrl, R.string.gdpr_type_analytics, false);

BottomSheet INFO PAGE

Sliding down the BottomSheet Info Page will dismiss the whole consent dialog instead of going back to the main dialog. I think it should go back to the main page even if not forcing the user to consent.

Min SDK can be 14.

Please keep the minimum SDK to be 14.
Admob supports minSdkVersion >= 14.
Keeping it 14 will enable all developers (like me) to use GDPR Dialog.

GDPRNetwork.isAdNetwork() on a null object reference

can not start in my application. Error
`
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.michaelflisar.gdprdialog.GDPRNetwork.isAdNetwork()' on a null object reference
at com.michaelflisar.gdprdialog.GDPRSetup.containsAdNetwork(GDPRSetup.java:314)
at com.michaelflisar.gdprdialog.helper.GDPRViewManager.initGeneralTexts(GDPRViewManager.java:279)
at com.michaelflisar.gdprdialog.helper.GDPRViewManager.init(GDPRViewManager.java:154)
at com.michaelflisar.gdprdialog.GDPRDialog.initView(GDPRDialog.java:147)
at com.michaelflisar.gdprdialog.GDPRDialog.onCreateView(GDPRDialog.java:73)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2346)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1428)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2596)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2383)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:703)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6176)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

`

Translations

@MMarco94 @thubalek
Can you just give me the translation for following string:

gdpr_show_me_partners: "Show partners"

Simply write it in this issue, no need for a PR... Then I can release the new version today...

the dialog does not appear

what am I doing wrong? my code

       GDPRSetup mSetup = new GDPRSetup(GDPRDefinitions.ADMOB, GDPRDefinitions.FIREBASE_ANALYTICS);
        mSetup.withCheckRequestLocation(false);
        GDPR.getInstance().checkIfNeedsToBeShown(this, mSetup);

and this

    @Override
    public void onConsentNeedsToBeRequested(GDPRLocation location) {
        // we need to get consent, so we show the dialog here
        GDPR.getInstance().showDialog(this, mSetup, location);
    }

Some ideas from Google Consent SDK

I tried implementing the Consent SDK and I noticed some small differences compared to the MoPub solution in the consent flow/content. Below some screenshots and video too.

In the Consent SDK:

  1. Back button does not close Dialogue nor Navigate Back (have own Back button in the dialogue layout)
  2. CONSENT YES: just close the dialogue without any more confirmation messages
  3. CONSENT NO (non personalized ads): next dialogue asks to actually Agree to non personalized or Back (not a simple Close as MoPub)
  4. link to new dialogue to show all the Links of Networks, Services and Partners. (with the main/first dialogue not referencing directly any names of Networks or Partners or Services)
  5. link to the App own Privacy Policy (in the other 2 dialogues other than the main one)

Personally I think the first 3 points are good and the 4-5 are worth considering.

ezgif-5-7a9ea058d1
Image
device-2018-05-23-012528
device-2018-05-23-012507

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.