-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb41f0d
commit f247200
Showing
11 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>titanium-firebase-analytics</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>com.appcelerator.titanium.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.aptana.ide.core.unifiedBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>com.appcelerator.titanium.mobile.module.nature</nature> | ||
<nature>com.aptana.projects.webnature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Files in this folder are copied directory into the compiled product directory | ||
when the Android app is compiled: | ||
|
||
<project-dir>/build/android/bin/assets/Resources/ | ||
|
||
Files in this directory are copied directly on top of whatever files are already | ||
in the build directory, so please be careful that your files don't clobber | ||
essential project files or files from other modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<project name="titanium-firebase-analytics" default="dist"> | ||
<description> | ||
Ant build script for Titanium Android module titanium-firebase-analytics | ||
</description> | ||
|
||
<property name="ti.module.root" location="${basedir}"/> | ||
<property file="build.properties" /> | ||
|
||
<!-- Make sure 'architectures' is in manifest file --> | ||
<property file="${ti.module.root}/manifest" prefix="manifest"/> | ||
<fail message="Missing required manifest key 'architectures'."> | ||
<condition> | ||
<not> | ||
<isset property="manifest.architectures"/> | ||
</not> | ||
</condition> | ||
</fail> | ||
|
||
<fail message="Manifest key 'architectures' has no value."> | ||
<condition> | ||
<not> | ||
<length string="${manifest.architectures}" trim="true" when="greater" length="0"/> | ||
</not> | ||
</condition> | ||
</fail> | ||
|
||
<!-- Copy documentation subdirectories --> | ||
<mkdir dir="${basedir}/documentation"/> | ||
<copy todir="${basedir}/documentation"> | ||
<fileset dir="${basedir}/../documentation"/> | ||
</copy> | ||
|
||
<!-- Copy example subdirectories --> | ||
<mkdir dir="${basedir}/example"/> | ||
<copy todir="${basedir}/example"> | ||
<fileset dir="${basedir}/../example"/> | ||
</copy> | ||
|
||
<!-- Copy assets subdirectories --> | ||
<mkdir dir="${basedir}/assets"/> | ||
<copy todir="${basedir}/assets"> | ||
<fileset dir="${basedir}/../assets"/> | ||
</copy> | ||
|
||
<!-- Copy license --> | ||
<copy todir="${basedir}" file="${basedir}/../LICENSE"/> | ||
|
||
<target name="cleancopy" description="Delete old copies"> | ||
<delete dir="${basedir}/documentation"/> | ||
<delete dir="${basedir}/example"/> | ||
<delete dir="${basedir}/assets"/> | ||
<delete file="${basedir}/LICENSE"/> | ||
</target> | ||
|
||
<import file="${titanium.platform}/../module/android/build.xml"/> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"/Users/hknoechel/Documents/appcelerator_modules/titanium-firebase/titanium-firebase-analytics/android/src/firebase/analytics/TitaniumFirebaseAnalyticsModule.java" | ||
"/Users/hknoechel/Documents/appcelerator_modules/titanium-firebase/titanium-firebase-analytics/android/build/generated/java/firebase/analytics/TitaniumFirebaseAnalyticsBootstrap.java" | ||
"/Users/hknoechel/Documents/appcelerator_modules/titanium-firebase/titanium-firebase-analytics/android/build/generated/r/android/support/compat/R.java" | ||
"/Users/hknoechel/Documents/appcelerator_modules/titanium-firebase/titanium-firebase-analytics/android/build/generated/r/android/support/design/R.java" | ||
"/Users/hknoechel/Documents/appcelerator_modules/titanium-firebase/titanium-firebase-analytics/android/build/generated/r/android/support/v7/appcompat/R.java" | ||
"/Users/hknoechel/Documents/appcelerator_modules/titanium-firebase/titanium-firebase-analytics/android/build/generated/r/android/support/v7/cardview/R.java" | ||
"/Users/hknoechel/Documents/appcelerator_modules/titanium-firebase/titanium-firebase-analytics/android/build/generated/r/firebase/analytics/R.java" | ||
"/Users/hknoechel/Documents/appcelerator_modules/titanium-firebase/titanium-firebase-analytics/android/build/generated/r/ti/modules/titanium/ui/R.java" |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# this is your module manifest and used by Titanium | ||
# during compilation, packaging, distribution, etc. | ||
# | ||
version: 1.0.0 | ||
apiversion: 3 | ||
architectures: armeabi-v7a x86 | ||
description: titanium-firebase-analytics | ||
author: Hans Knoechel | ||
license: Apache 2 | ||
copyright: Copyright (c) 2017 by Axway Appcelerator | ||
|
||
# these should not be edited | ||
name: titanium-firebase-analytics | ||
moduleid: firebase.analytics | ||
guid: a1f48874-bd3a-4378-b623-79012aad1d20 | ||
platform: android | ||
minsdk: 6.2.2.GA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Files in this folder are copied directory into the Android build directory | ||
when the Android app is compiled: | ||
|
||
<project-dir>/build/android | ||
|
||
You can place files such as res strings or drawable files. | ||
|
||
Files in this directory are copied directly on top of whatever files are already | ||
in the build directory, so please be careful that your files don't clobber | ||
essential project files or files from other modules. |
63 changes: 63 additions & 0 deletions
63
android/src/firebase/analytics/TitaniumFirebaseAnalyticsModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* This file was auto-generated by the Titanium Module SDK helper for Android | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
* | ||
*/ | ||
package firebase.analytics; | ||
|
||
import org.appcelerator.kroll.KrollDict; | ||
import org.appcelerator.kroll.KrollModule; | ||
import org.appcelerator.kroll.common.Log; | ||
import org.appcelerator.kroll.common.TiConfig; | ||
import org.appcelerator.kroll.annotations.Kroll; | ||
|
||
import org.appcelerator.titanium.TiApplication; | ||
import org.appcelerator.titanium.util.TiConvert; | ||
|
||
import android.os.Bundle; | ||
|
||
import com.google.firebase.analytics.FirebaseAnalytics; | ||
import com.google.firebase.analytics.FirebaseAnalytics.Param; | ||
|
||
@Kroll.module(name="TitaniumFirebaseAnalytics", id="firebase.analytics") | ||
public class TitaniumFirebaseAnalyticsModule extends KrollModule | ||
{ | ||
private static final String LCAT = "TitaniumFirebaseAnalyticsModule"; | ||
private static final boolean DBG = TiConfig.LOGD; | ||
|
||
public TitaniumFirebaseAnalyticsModule() | ||
{ | ||
super(); | ||
} | ||
|
||
@Kroll.method | ||
public void log(String name, KrollDict parameters) | ||
{ | ||
Bundle bundle = new Bundle(); | ||
|
||
// TODO: Loop through all keys and set accordingly | ||
if (parameters.containsKey(Param.ACHIEVEMENT_ID)) { | ||
bundle.putString(Param.ACHIEVEMENT_ID, TiConvert.toString(parameters, Param.ACHIEVEMENT_ID)); | ||
} | ||
|
||
FirebaseAnalytics.getInstance(TiApplication.getInstance().getApplicationContext()). | ||
logEvent(name, bundle); | ||
} | ||
|
||
@Kroll.method @Kroll.setProperty | ||
public void setUserPropertyString(KrollDict parameters) | ||
{ | ||
FirebaseAnalytics.getInstance(TiApplication.getInstance().getApplicationContext()). | ||
setUserProperty(TiConvert.toString(parameters, "name"), TiConvert.toString(parameters, "value")); | ||
} | ||
|
||
@Kroll.method @Kroll.setProperty | ||
public void setScreenNameAndScreenClass(KrollDict parameters) | ||
{ | ||
Log.e(LCAT, "Firebase.setScreenNameAndScreenClass() is not implemented on Android, yet!"); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ti:module xmlns:ti="http://ti.appcelerator.org" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<android xmlns:android="http://schemas.android.com/apk/res/android" /> | ||
<modules> | ||
<module platform="android">ti.playservices</module> | ||
</modules> | ||
</ti:module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Place your assets like PNG files in this directory and they will be packaged | ||
with your module. | ||
|
||
All JavaScript files in the assets directory are IGNORED except if you create a | ||
file named "firebase.analytics.js" in this directory in which case it will be | ||
wrapped by native code, compiled, and used as your module. This allows you to | ||
run pure JavaScript modules that are pre-compiled. | ||
|
||
Note: Mobile Web does not support this assets directory. |