-
Notifications
You must be signed in to change notification settings - Fork 1
Feature - Adobe Implementation #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| configurations.maybeCreate("default") | ||
| artifacts.add("default", file('adobeMobileLibrary-4.13.2.jar')) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #Tue May 02 16:55:48 EDT 2017 | ||
| #Wed Jun 14 16:32:12 EDT 2017 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| include ':simcoe' | ||
| include ':simcoe', ':simcoe-adobe', ':adobeMobileLibrary' | ||
| include ':simcoe-mixpanel' | ||
| include ':sample' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /build |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| apply plugin: 'com.android.library' | ||
|
|
||
| android { | ||
| compileSdkVersion rootProject.ext.compileSdkVersion | ||
| buildToolsVersion rootProject.ext.buildToolsVersion | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion rootProject.ext.minSdkVersion | ||
| targetSdkVersion rootProject.ext.targetSdkVersion | ||
|
|
||
| versionCode Integer.parseInt(project.VERSION_CODE) | ||
| versionName project.VERSION_NAME | ||
|
|
||
| testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
| } | ||
| buildTypes { | ||
| release { | ||
| minifyEnabled false | ||
| proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation project(':simcoe') | ||
|
|
||
| implementation project(':adobeMobileLibrary') | ||
|
|
||
| testCompile 'junit:junit:4.12' | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # By default, the flags in this file are appended to flags specified | ||
| # in /Users/ellingtonkirby/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
| # You can edit the include path and order by changing the proguardFiles | ||
| # directive in build.gradle. | ||
| # | ||
| # For more details, see | ||
| # http://developer.android.com/guide/developing/tools/proguard.html | ||
|
|
||
| # Add any project specific keep options here: | ||
|
|
||
| # 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="scotts.com.simcoe_adobe"/> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package com.prolificinteractive.adobe | ||
|
|
||
| import android.content.Context | ||
| import com.adobe.mobile.Analytics | ||
| import com.adobe.mobile.AudienceManager | ||
| import com.prolificinteractive.simcoe.Properties | ||
| import com.prolificinteractive.simcoe.Success | ||
| import com.prolificinteractive.simcoe.TrackingResult | ||
| import com.prolificinteractive.simcoe.trackers.EventTracking | ||
| import com.prolificinteractive.simcoe.trackers.PageViewTracking | ||
| import com.prolificinteractive.simcoe.trackers.TimedEventTracking | ||
|
|
||
| /** | ||
| * Creates a new adobe analytics provider instance. | ||
| */ | ||
|
|
||
| class AdobeProvider(private val token: String ="", private val appName: String) : | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am gonna be removing the token. I am having trouble getting the project to build, it keeps complaining that the prolific-adobe package does not exist. was hoping to get some help on it |
||
| EventTracking, PageViewTracking, TimedEventTracking { | ||
| override fun startTimedEvent(eventName: String, properties: Properties?): TrackingResult { | ||
| Analytics.trackTimedActionStart(eventName, properties) | ||
| return Success() | ||
| } | ||
|
|
||
| override fun stopTimedEvent(eventName: String, properties: Properties?): TrackingResult { | ||
| Analytics.trackTimedActionEnd(eventName, Analytics.TimedActionBlock { l1, l2, map -> | ||
| map.putAll(properties as Map<out String, Any>) | ||
| //needed to return it like this or else it tryed to return out of the whole fun | ||
| return@TimedActionBlock true | ||
| } | ||
| ) | ||
| return Success() | ||
| } | ||
|
|
||
| companion object { | ||
| private val ADOBE_PROVIDER_NAME = "Adobe" | ||
| private val APP = "app" | ||
| } | ||
|
|
||
| override fun providerName(): String { | ||
| return ADOBE_PROVIDER_NAME | ||
| } | ||
|
|
||
| override fun start(context: Context) { | ||
| val map: Map<String, Any> = HashMap() | ||
| map.plus(Pair(APP, appName)) | ||
| AudienceManager.signalWithData(map, null) | ||
| } | ||
|
|
||
| override fun trackPageView(pageName: String, properties: Properties?): TrackingResult { | ||
| Analytics.trackState(pageName, properties) | ||
| trackSingleValueWithAudienceManager(pageName, properties) | ||
| return Success() | ||
| } | ||
|
|
||
| override fun trackEvent(eventName: String, properties: Properties?): TrackingResult { | ||
| Analytics.trackAction(eventName, properties) | ||
| AudienceManager.signalWithData(properties, null) | ||
| return Success() | ||
| } | ||
|
|
||
| override fun stop() { | ||
| } | ||
|
|
||
| private fun trackSingleValueWithAudienceManager(value: String, properties: Properties?) { | ||
| val map: Map<String, Any> = HashMap() | ||
| map.plus(Pair(value, properties)) | ||
| AudienceManager.signalWithData(map, null) | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <resources> | ||
| <string name="app_name">simcoe-adobe</string> | ||
| </resources> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up the latest version is
gradle-4.0