All Projects β†’ hansemannn β†’ titanium-firebase-analytics

hansemannn / titanium-firebase-analytics

Licence: other
Use the Firebase Analytics SDK in Axway Titanium πŸš€

Programming Languages

objective c
16641 projects - #2 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to titanium-firebase-analytics

titanium-turbo
Axway Amplify module that adds some enhancements for Appcelerator Titanium Alloy
Stars: ✭ 15 (-54.55%)
Mutual labels:  native, titanium, appcelerator, axway
ti.playservices
Titanium module for Google Play Services
Stars: ✭ 19 (-42.42%)
Mutual labels:  native, titanium, appcelerator, axway
titanium-arkit
Use the iOS 11 ARKit API in Axway Titanium
Stars: ✭ 28 (-15.15%)
Mutual labels:  native, titanium, appcelerator, axway
griffin-app-opensource
The Axway Griffin App goes open source!
Stars: ✭ 19 (-42.42%)
Mutual labels:  native, titanium, appcelerator, axway
nl.fokkezb.loading
The widget provides a simple loading mask that can be easily styled and configured.
Stars: ✭ 96 (+190.91%)
Mutual labels:  titanium, appcelerator, axway
ti.admob
Use the Google AdMob SDK on iOS and Android with Titanium
Stars: ✭ 51 (+54.55%)
Mutual labels:  native, titanium, appcelerator
ti.paint
Touch-based painting with the Titanium SDK.
Stars: ✭ 27 (-18.18%)
Mutual labels:  native, titanium, appcelerator
ti.exoplayer
A native control for playing videos for Titanium. Based on Google ExoPlayer, using Titanium.Media.VideoPlayer API.
Stars: ✭ 17 (-48.48%)
Mutual labels:  titanium, appcelerator, axway
av.imageview
Titanium native ImageView module that extends the default Titanium ImageView with more capabilities and a different caching system.
Stars: ✭ 97 (+193.94%)
Mutual labels:  native, titanium, appcelerator
ti.coremotion
Support for the native iOS CoreMotion framework in Appcelerator Titanium
Stars: ✭ 15 (-54.55%)
Mutual labels:  native, titanium, appcelerator
titanium-dark-mode
Full support for iOS 13+ / Android 10+ dark mode (semantic colors and images) in Appcelerator Titanium
Stars: ✭ 26 (-21.21%)
Mutual labels:  titanium, appcelerator, axway
titanium-material
Use the native Material UI/UX framework (https://github.com/CosmicMind/Material) in Titanium!
Stars: ✭ 14 (-57.58%)
Mutual labels:  native, titanium, appcelerator
ti.map
Use native Apple Maps & Google Maps in iOS and Android with Axway Titanium
Stars: ✭ 49 (+48.48%)
Mutual labels:  native, titanium, appcelerator
Titanium mobile
πŸš€ Native iOS- and Android- Apps with JavaScript
Stars: ✭ 2,553 (+7636.36%)
Mutual labels:  native, titanium, appcelerator
abifestival-app
Cross-platform festival-app built with the Appcelerator Titanium framework
Stars: ✭ 16 (-51.52%)
Mutual labels:  native, titanium
titanium-vue
Use Vue.js to easily create native mobile apps with Axway Appcelerator Titanium.
Stars: ✭ 45 (+36.36%)
Mutual labels:  native, titanium
ti.accountkit
DEPRECATED -- πŸ” Use the Facebook AccountKit iOS-SDK with Titanium Mobile.
Stars: ✭ 18 (-45.45%)
Mutual labels:  native, titanium
vscode-appcelerator-titanium
Appcelerator development tools and UI package for Visual Studio Code.
Stars: ✭ 35 (+6.06%)
Mutual labels:  titanium, appcelerator
titanium-paypal
πŸ’° Use the PayPal iOS-SDK 2.x with Titanium Mobile.
Stars: ✭ 22 (-33.33%)
Mutual labels:  native, appcelerator
titanium-web-dialog
Use the SFSafariViewController (iOS) and Chrome Pages (Android) in Titanium.
Stars: ✭ 28 (-15.15%)
Mutual labels:  native, titanium

Firebase Analytics - Titanium Module

Use the native Firebase SDK in Axway Titanium. This repository is part of the Titanium Firebase project.

⚠️ This module complies to the EU General Data Protection Regulation (GDPR) regulation already. Use the enabled property to enable or disable Analytics and resetAnalyticsData() to make Cambridge Analytica angry πŸ˜™.

Supporting this effort

The whole Firebase support in Titanium is developed and maintained by the community (@hansemannn and @m1ga). To keep this project maintained and be able to use the latest Firebase SDK's, please see the "Sponsor" button of this repository, thank you!

Requirements

  • The Firebase Core module (iOS only)
  • iOS: Titanium SDK 6.2.0+
  • Android: Titanium SDK 7.0.0+

Installation

In general, make sure to follow the general instructions described in the main project.

iOS

No additional setup required for Firebase Analytics on iOS.

Android

There are a few additional requirements for Firebase Analytics on Android:

  1. Copy the following code under the <application> tag of your tiapp.xml. Please note to replace all occurrences of MY_PACKAGE_NAME with your actual package name (= <id> in your tiapp.xml):
<android xmlns:android="http://schemas.android.com/apk/res/android">
	<manifest>
		<application>
			<service android:name="com.google.android.gms.measurement.AppMeasurementService" android:enabled="true" android:exported="false" />

			<service android:name="com.google.android.gms.measurement.AppMeasurementJobService" android:permission="android.permission.BIND_JOB_SERVICE" android:enabled="true" android:exported="false" />

			<service android:name="MY_PACKAGE_NAME.gcm.RegistrationIntentService" android:exported="false" />

			<receiver android:name="com.google.android.gms.measurement.AppMeasurementReceiver" android:enabled="true">
			   <intent-filter>
				  <action android:name="com.google.android.gms.measurement.UPLOAD" />
			   </intent-filter>
			</receiver>  

			<!-- Only add the GCM-related tags if you are using push notifications as well -->
			<service android:name="MY_PACKAGE_NAME.gcm.GcmIntentService" android:exported="false">
			   <intent-filter>
				  <action android:name="com.google.android.c2dm.intent.RECEIVE" />
				  <action android:name="com.google.android.c2dm.intent.SEND" />
			   </intent-filter>
			</service>

			<service android:name="MY_PACKAGE_NAME.gcm.GcmIDListenerService" android:exported="false">
			   <intent-filter>
				  <action android:name="com.google.android.gms.iid.InstanceID" />
			   </intent-filter>
			</service>
		</application>
	</manifest>
</android>   
  1. Create a file strings.xml that is located at:

    • Alloy: <project-dir>/app/platform/android/res/values/strings.xml
    • Classic: <project-dir>/platform/android/res/values/strings.xml

    with your Firebase Application ID (mobilesdk_app_id from the JSON file) content:

<?xml version="1.0" encoding="UTF-8"?>
<resources>
	<string name="google_app_id">YOUR_FIREBASE_APPLICATION_ID</string>
</resources>

Download

API's

FirebaseAnalytics

Methods

log(name, parameters)
  • name (String)
  • parameters (Dictionary, optional)

Logs an app event. The event can have up to 25 parameters. Events with the same name must have the same parameters. Up to 500 event names are supported.

Make sure to check the Log Events docs to validate that you are using a valid event name (1st parameter) and parameter structure (2nd event).

saveUserProperty(parameters)
  • parameters (Dictionary)
    • value (String)
    • name (String)

Sets a user property to a given value. Up to 25 user property names are supported. Once set, user property values persist throughout the app lifecycle and across sessions.

setScreenNameAndScreenClass(parameters)
  • parameters (Dictionary)
    • screenName (String)
    • screenClass (String, defaults to TiController)

Sets the current screen name, which specifies the current visual context in your app. This helps identify the areas in your app where users spend their time and how they interact with your app.

resetAnalyticsData() (iOS-only, on Android requires /lib version > 11.6.0)

Clears all analytics data for this app from the device and resets the app instance id.

Properties

enabled (Boolean, set)

Sets whether analytics collection is enabled for this app on this device. This setting is persisted across app sessions. By default it is enabled.

appInstanceID (String, get, iOS-only)

Instance ID provides a unique identifier for each app instance and a mechanism to authenticate and authorize actions (for example, sending an FCM message).

userID (String, set)

The user ID to ascribe to the user of this app on this device, which must be non-empty and no more than 256 characters long. Setting userID to null removes the user ID.

Example

// Require the Firebase Core module (own project!)
if (OS_IOS) {
  var FirebaseCore = require('firebase.core');
  FirebaseCore.configure();
}

// Require the Firebase Analytics module
var FirebaseAnalytics = require('firebase.analytics');

// Get the App Instance ID
Ti.API.info('App Instance ID: ' + FirebaseAnalytics.appInstanceID);

// Log to the Firebase console
FirebaseAnalytics.log('My_Event', { /* Optional arguments */ });

// Set user-property string
FirebaseAnalytics.setUserPropertyString({
  name: 'My_Name',
  value: 'My Value'
});

// Set User-ID
FirebaseAnalytics.userID = 'MyUserID';

// Set screen-name  and screen-class
FirebaseAnalytics.setScreenNameAndScreenClass({
  screenName: 'ScreenName',
  screenClass: 'ScreenClass'
});

// Toogle analytics on/off (default: on / true)
FirebaseAnalytics.enabled = false;

Update SDK's

  • Android: Using Gradle command gradle getDeps
  • iOS: Downloading the latest framework

Build

cd ios
appc run -p [ios|android] --build-only

Legal

This module is Copyright (c) 2017-Present by Hans KnΓΆchel. All Rights Reserved.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].