Skip to content

Commit

Permalink
Release 5.7.0 (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamayok authored Feb 12, 2020
1 parent 3ab46ee commit 2199b1f
Show file tree
Hide file tree
Showing 65 changed files with 2,106 additions and 309 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

- 5.7.0
- Update Gradle to latest version to fix Proguard issues
- Location 1.0.0
- Location tracking based on defined geofence
- New Event Attributes:
- `geofence_name`
- `geofence_transition_type`
- `location_accuracy`
- `device_last_latitude`
- `device_last_longitude`
- 5.6.2
- Embed proguard-rules
- All Modules - proguard-rules are now embedded in each module
Expand All @@ -20,7 +29,7 @@
- 5.5.5
- Webview bug fix: disable Hardware Acceleration for Tealium webview
- Install Referrer 1.1.2
- Placement of endconnection() to more appropriate location
- Bug fix: resolve referrerClient NPE by adding `endConnection()` after establishing connection
- 5.5.4
- Fixed VisitorProfile URL to default to profile provided in Tealium.Config
- 5.5.3
Expand Down
5 changes: 5 additions & 0 deletions Modules/Location/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.gradle
*.iml
build
local.properties
13 changes: 13 additions & 0 deletions Modules/Location/LocationSample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
1 change: 1 addition & 0 deletions Modules/Location/LocationSample/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
40 changes: 40 additions & 0 deletions Modules/Location/LocationSample/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "com.example.tealiumlocationdemoapp"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

// Tealium dependencies
implementation 'com.tealium:library:5.7.0'
implementation 'com.tealium:location:1.0.0'

// Other required dependencies
runtimeOnly 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.optimizely.ab:android-sdk:2.1.0'

// Testing dependencies
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
3 changes: 3 additions & 0 deletions Modules/Location/LocationSample/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"_comment": "INSERT YOUR GOOGLE-SERVICES.JSON CONFIGURATION HERE"
}
25 changes: 25 additions & 0 deletions Modules/Location/LocationSample/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep com.tealium.internal.** {
*;
}
37 changes: 37 additions & 0 deletions Modules/Location/LocationSample/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tealiumlocationdemoapp">

<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">
<service
android:name=".TealiumFirebaseMessagingService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LocationTracking" />
<activity android:name=".LocationConfig" />
<activity android:name=".LocationAssets" />
<activity android:name=".LocationUrl" />
<activity android:name=".LocationGeofencing" />
</application>

</manifest>
22 changes: 22 additions & 0 deletions Modules/Location/LocationSample/app/src/main/Assets/geofences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"name": "Tealium_asset1",
"latitude": 59.4610304,
"longitude": -9.9707625,
"radius": 100,
"expire_after": -1,
"trigger_on_enter": true,
"trigger_on_exit": true,
"minimum_dwell_time": 0
},
{
"name": "Tealium_asset2",
"latitude": 39.9061189,
"longitude": -142.2379163,
"radius": 100,
"expire_after": -1,
"trigger_on_enter": true,
"trigger_on_exit": true,
"minimum_dwell_time": 0
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.example.tealiumlocationdemoapp;

import android.app.Application;

public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
TealiumHelper.initialize(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.example.tealiumlocationdemoapp;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.tealium.location.TealiumLocation;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class LocationAssets extends Activity {

private boolean mLocationShowcaseStarted = false;
private TealiumLocation mInstance;
private final String mGeofenceJsonFile = "geofences.json";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_assets);

findViewById(R.id.location_assets_button_update)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mLocationShowcaseStarted) {
drawActiveGeofences();
drawUsedAssets();
} else {
showToast("Please press Start first!");
}
}
});

findViewById(R.id.location_assets_button_start)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!mLocationShowcaseStarted) {
startLocationShowcase();
} else {
showToast("Showcase Already Started!");
}
}
});

findViewById(R.id.location_assets_button_stop).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!mLocationShowcaseStarted) {
showToast("Please press Start first!");
}
}
});
}

private void startLocationShowcase() {
mLocationShowcaseStarted = true;

Set<String> tealiumInstances = new HashSet<>();
tealiumInstances.add(TealiumHelper.TEALIUM_MAIN);

mInstance = TealiumLocation.setupInstanceWithFile(this, tealiumInstances, mGeofenceJsonFile);
mInstance.startLocationUpdates(true, 5000);
drawUsedAssets();
drawActiveGeofences();
}

private void drawActiveGeofences() {
List<String> activeGeofences = mInstance.getAllGeofenceNames();
String geofenceNames = "";

for (String name : activeGeofences) {
geofenceNames = geofenceNames + name + "\n";
}

TextView geofenceNameData = findViewById(R.id.location_assets_geofencesdata);
geofenceNameData.setText(geofenceNames);
}

private void drawUsedAssets() {
TextView urlData = findViewById(R.id.location_assets_assetsdata);
urlData.setText(mGeofenceJsonFile);
}

private void showToast(String message) {
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
}

@Override
public void onDestroy() {
super.onDestroy();
if (mLocationShowcaseStarted) {
TealiumLocation.destroyInstance();
}
}
}
Loading

0 comments on commit 2199b1f

Please sign in to comment.