Skip to content

Commit

Permalink
Merge branch 'avitale' of https://github.com/caffeinalab/Ti.GA into c…
Browse files Browse the repository at this point in the history
…affeinalab-avitale
  • Loading branch information
Astrovic authored and Astrovic committed Jan 23, 2018
1 parent 0537ab8 commit a5d9e6b
Show file tree
Hide file tree
Showing 49 changed files with 1,332 additions and 77 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ profile
*.moved-aside
DerivedData
.idea
build.properties
.DS_Store
android/libs
6 changes: 3 additions & 3 deletions Android/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ titanium.version=7.0.1.GA
android.sdk=/Users/Astrovic/Dati/Applicazioni/android-sdk

titanium.platform=${titanium.sdk}/mobilesdk/${titanium.os}/${titanium.version}/android
android.platform=${android.sdk}/platforms/android-25
google.apis=${android.sdk}/add-ons/addon_google_apis_google_inc_23
android.ndk=/Users/Astrovic/Dati/Applicazioni/android-sdk/ndk-bundle
android.platform=${android.sdk}/platforms/android-26
google.apis=${android.sdk}/add-ons/addon-google_apis-google-23
android.ndk=/Users/Astrovic/Dati/Applicazioni/android-ndk/android-ndk-r14b
Binary file removed Android/dist/ti.ga-android-3.0.8.zip
Binary file not shown.
Binary file added Android/dist/ti.ga-android-4.0.1.zip
Binary file not shown.
Binary file removed Android/libs/armeabi-v7a/libti.ga.so
Binary file not shown.
Binary file removed Android/libs/x86/libti.ga.so
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file modified android/dist/tiga.jar
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions android/java-sources.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/DictionaryBuilderProxy.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/TigaModule.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/TrackerProxy.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/builders/DictionaryBuilderInterface.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/builders/EventBuilder.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/builders/ScreenViewBuilder.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/ecommerce/ProductActionProxy.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/ecommerce/ProductProxy.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/ecommerce/PromotionProxy.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/src/ti/ga/ecommerce/ScreenViewBuilderProxy.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/build/generated/java/ti/ga/TigaBootstrap.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/build/generated/r/android/support/compat/R.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/build/generated/r/android/support/design/R.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/build/generated/r/android/support/v7/appcompat/R.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/build/generated/r/android/support/v7/cardview/R.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/build/generated/r/com/google/android/gms/R.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/build/generated/r/ti/ga/R.java"
"/Users/Astrovic/Dati/Applicazioni/Ti.GA/Android/build/generated/r/ti/modules/titanium/ui/R.java"
File renamed without changes.
Binary file not shown.
4 changes: 2 additions & 2 deletions Android/manifest → android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 3.0.8
version: 4.0.1
apiversion: 4
architectures: arm64-v8a armeabi-v7a x86
description: tiga
Expand All @@ -15,4 +15,4 @@ name: tiga
moduleid: ti.ga
guid: e0babc76-21f5-4fbf-8581-ae0b00235068
platform: android
minsdk: 7.0.0
minsdk: 7.0.0.GA
58 changes: 58 additions & 0 deletions android/src/ti/ga/DictionaryBuilderProxy.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package ti.ga;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;

import android.util.Log;
import android.text.TextUtils;

import ti.ga.builders.DictionaryBuilderInterface;
import ti.ga.builders.EventBuilder;
import ti.ga.builders.ScreenViewBuilder;

import ti.ga.ecommerce.ProductProxy;
import ti.ga.ecommerce.ProductActionProxy;
import ti.ga.ecommerce.PromotionProxy;

@Kroll.proxy(creatableInModule=TigaModule.class)
public class DictionaryBuilderProxy extends KrollProxy {
private String LCAT = "ti.ga.DictionaryBuilderProxy";
private DictionaryBuilderInterface builder;

public DictionaryBuilderProxy() {
super();
}

public void handleCreationDict(KrollDict args) {
if (args.containsKey("type") && args.getString("type").equals(TigaModule.BUILDER_TYPE_EVENT)) {
this.builder = new EventBuilder(args.getKrollDict("options"));
} else {
this.builder = new ScreenViewBuilder();
}
}

@Kroll.method
public void addProduct(ProductProxy product) {
this.builder.addProduct(product.getNative());
}

@Kroll.method
public void setProductAction(ProductActionProxy action) {
this.builder.setProductAction(action.getNative());
}

@Kroll.method
public void addPromotion(PromotionProxy promotion) {
this.builder.addPromotion(promotion.getNative());
}

@Kroll.method
public void addImpression(ProductProxy product, String impressionList) {
this.builder.addImpression(product.getNative(), impressionList);
}

public DictionaryBuilderInterface getNative() {
return this.builder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,38 @@
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.kroll.common.Log;

import com.google.android.gms.analytics.ecommerce.ProductAction;
import com.google.android.gms.analytics.ecommerce.Promotion;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Logger.LogLevel;


@Kroll.module(name="Tiga", id="ti.ga")
public class TigaModule extends KrollModule
{
@Kroll.constant public static final String BUILDER_TYPE_SCREEN = "screen";
@Kroll.constant public static final String BUILDER_TYPE_EVENT = "event";

@Kroll.constant public static final String PRODUCT_ACTION_ADD = ProductAction.ACTION_ADD;
@Kroll.constant public static final String PRODUCT_ACTION_CHECKOUT = ProductAction.ACTION_CHECKOUT;
@Kroll.constant public static final String PRODUCT_ACTION_CHECKOUT_OPTION = ProductAction.ACTION_CHECKOUT_OPTION;
@Kroll.constant public static final String PRODUCT_ACTION_CLICK = ProductAction.ACTION_CLICK;
@Kroll.constant public static final String PRODUCT_ACTION_DETAIL = ProductAction.ACTION_DETAIL;
@Kroll.constant public static final String PRODUCT_ACTION_PURCHASE = ProductAction.ACTION_PURCHASE;
@Kroll.constant public static final String PRODUCT_ACTION_REFUND = ProductAction.ACTION_REFUND;
@Kroll.constant public static final String PRODUCT_ACTION_REMOVE = ProductAction.ACTION_REMOVE;

@Kroll.constant public static final String PROMOTION_ACTION_CLICK = Promotion.ACTION_CLICK;
@Kroll.constant public static final String PROMOTION_ACTION_VIEW = Promotion.ACTION_VIEW;

public static final String MODULE_FULL_NAME = "ti.ga";
private final GoogleAnalytics _ga;
private int _dispatchInterval = 30;

public TigaModule()
{
super();
_ga = GoogleAnalytics.getInstance(TiApplication.getInstance().getApplicationContext());
_ga = GoogleAnalytics.getInstance(TiApplication.getInstance().getApplicationContext());
}

@Kroll.onAppCreate
Expand All @@ -43,7 +59,7 @@ public void setTrackUncaughtExceptions()
{
Log.d(MODULE_FULL_NAME,"setTrackUncaughtExceptions is only available on iOS");
}

@Kroll.method
public void setDebug(boolean value) {
if(value){
Expand All @@ -57,11 +73,11 @@ public void setDebug(boolean value) {
public void dispatch() {
_ga.dispatchLocalHits();
}

// Properties
@Kroll.getProperty
public long getDispatchInterval()
{
{
return _dispatchInterval;
}

Expand Down
Loading

0 comments on commit a5d9e6b

Please sign in to comment.