Skip to content

Commit

Permalink
Update Teads SDK to v4.1.1 (#120)
Browse files Browse the repository at this point in the history
* Update Teads SDK to v4.1.1
  • Loading branch information
HugoGresse authored Nov 19, 2018
1 parent 95da49d commit 6ec9d39
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 17 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Changelog

##### v4.1.0
### v4.1.1
_2018-11-19_
- fix `CustomAdView` & `InReadAdView` state restoration
- fix `onAdVolumeChange` not fired on `TeadsListener`

### v4.1.0
_2018-10-23_
- improve load performance
- improve VPAID creative support
- add userConsent api for MoPub and AdMob adapters

**v4**
### v4
- Major API change. The SDK is now view based. The view can be added to your layout or inside a ViewHolder very easily **without** having to call unecessary method such as `onResume`. A migration guide will be published before final release.
- New ad format supported and improved VPAID support
- New logic behind the hood to reduce SDK update count
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories{
}
}
dependencies {
implementation("tv.teads.sdk.android:sdk:4.1.0@aar") {
implementation("tv.teads.sdk.android:sdk:4.1.1@aar") {
transitive = true
}
}
Expand Down
4 changes: 2 additions & 2 deletions TeadsSDKDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ allprojects {
ext {
// Libraries
groupId = "tv.teads.sdk.android"
libraryVersionCode = 48
libraryVersion = "4.1.0"
libraryVersionCode = 49
libraryVersion = "4.1.1"

//Global configurations
projectBuildToolsVersion = '28.0.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import android.util.Log;
import android.webkit.WebView;

import java.io.IOException;
import java.io.InputStream;

/**
Expand Down Expand Up @@ -77,23 +78,31 @@ protected void onTimeout() {
*/
void injectJS(Context context) {
if (mWebView != null && context != null) {
InputStream inputStream = null;
try {
InputStream inputStream = context.getAssets().open("bootstrap.js");
inputStream = context.getAssets().open("bootstrap.js");
byte[] buffer = new byte[inputStream.available()];
//noinspection ResultOfMethodCallIgnored
inputStream.read(buffer);
inputStream.close();
String encoded = Base64.encodeToString(buffer, Base64.NO_WRAP);
mWebView.loadUrl("javascript:(function() {" +
"var scriptElement = document.getElementById('teadsbootstrap');" +
" if(scriptElement) scriptElement.remove();" +
" var script = document.createElement('script');" +
"script.innerHTML = window.atob('" + encoded + "');" +
"script.setAttribute('id', 'teadsbootstrap');" +
"script.setAttribute('type', 'text/javascript');" +
" document.body.appendChild(script);})()");
"var scriptElement = document.getElementById('teadsbootstrap');" +
" if(scriptElement) scriptElement.remove();" +
" var script = document.createElement('script');" +
"script.innerHTML = window.atob('" + encoded + "');" +
"script.setAttribute('id', 'teadsbootstrap');" +
"script.setAttribute('type', 'text/javascript');" +
" document.body.appendChild(script);})()");
} catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions TeadsSDKDemo/webviewhelper/webviewhelper.iml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
</content>
<orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: tv.teads.sdk.android:network-4.1.0" level="project" />
<orderEntry type="library" name="Gradle: tv.teads.sdk.android:network-4.1.1" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:common:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:27.1.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:animated-vector-drawable-27.1.1" level="project" />
Expand All @@ -135,14 +135,14 @@
<orderEntry type="library" name="Gradle: com.android.support:support-v4-26.1.0" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.14.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-fragment-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: tv.teads.sdk.android:sdk-4.1.1" level="project" />
<orderEntry type="library" name="Gradle: android.arch.core:runtime-1.1.0" level="project" />
<orderEntry type="library" name="Gradle: tv.teads.sdk.android:sdk-4.1.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: org.greenrobot:eventbus:3.0.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.2@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata-core-1.1.0" level="project" />
<orderEntry type="library" name="Gradle: android.arch.core:common:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: tv.teads.sdk.android:logger-4.1.0" level="project" />
<orderEntry type="library" name="Gradle: tv.teads.sdk.android:logger-4.1.1" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:runtime-1.1.0" level="project" />
</component>
</module>

0 comments on commit 6ec9d39

Please sign in to comment.