Skip to content

Commit

Permalink
Version v1.0.4 of the Consent SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
youbamj committed Jun 9, 2018
1 parent dbdd707 commit 0bd3e0b
Show file tree
Hide file tree
Showing 22 changed files with 21 additions and 41 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Demo version app has been added for a better explanation of the library.
> Step 2. Add the dependency
```gradle
dependencies {
implementation 'com.github.ayoubfletcher.GDPR-Admob-Android:consentsdk:0.1.6'
implementation 'com.github.ayoubfletcher.GDPR-Admob-Android:consentsdk:0.1.7'
}
```
---
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.1.3'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 1 addition & 1 deletion consent-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ android {

dependencies {
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.code.gson:gson:2.8.4'
}

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#Sat Jun 02 08:41:19 GMT 2018
#Sat Jun 09 06:34:11 GMT 2018
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

class ConsentData {

private static final String SDK_PLATFORM = "android";

private static final String SDK_VERSION = "1.0.4";

@SerializedName("providers")
private HashSet<AdProvider> adProviders;

Expand All @@ -45,10 +49,10 @@ class ConsentData {
private String consentSource;

@SerializedName("version")
private final String sdkVersionString = "1.0.3";
private final String sdkVersionString;

@SerializedName("plat")
private final String sdkPlatformString = "android";
private final String sdkPlatformString;

@SerializedName("raw_response")
private String rawResponse;
Expand All @@ -61,6 +65,8 @@ class ConsentData {
this.consentStatus = ConsentStatus.UNKNOWN;
this.isRequestLocationInEeaOrUnknown = false;
this.hasNonPersonalizedPublisherId = false;
this.sdkVersionString = SDK_VERSION;
this.sdkPlatformString = SDK_PLATFORM;
this.rawResponse = "";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import android.annotation.TargetApi;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
Expand All @@ -27,10 +28,8 @@
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import android.view.ViewGroup;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
Expand Down Expand Up @@ -63,7 +62,6 @@ private enum LoadState {
}

private ConsentForm(Builder builder) {

this.context = builder.context;

if (builder.listener == null) {
Expand All @@ -76,10 +74,11 @@ private ConsentForm(Builder builder) {
this.nonPersonalizedAdsOption = builder.nonPersonalizedAdsOption;
this.adFreeOption = builder.adFreeOption;
this.appPrivacyPolicyURL = builder.appPrivacyPolicyURL;
this.dialog = new Dialog(context);
this.dialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar);
this.loadState = LoadState.NOT_READY;

this.webView = new WebView(context);
this.webView.setBackgroundColor(Color.TRANSPARENT);
this.dialog.setContentView(webView);
this.dialog.setCancelable(false);
webView.getSettings().setJavaScriptEnabled(true);
Expand Down Expand Up @@ -293,8 +292,12 @@ private void handleOpenBrowser(String urlString) {
return;
}

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlString));
context.startActivity(browserIntent);
try {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlString));
context.startActivity(browserIntent);
} catch (ActivityNotFoundException exception) {
listener.onConsentFormError("No Activity found to handle browser intent.");
}
}

private void handleDismiss(String status) {
Expand Down

0 comments on commit 0bd3e0b

Please sign in to comment.