{"id":21903908,"url":"https://github.com/hansemannn/titanium-firebase-analytics","last_synced_at":"2025-04-15T20:47:03.781Z","repository":{"id":25992477,"uuid":"107050893","full_name":"hansemannn/titanium-firebase-analytics","owner":"hansemannn","description":"Use the Firebase Analytics SDK in Axway Titanium 🚀","archived":false,"fork":false,"pushed_at":"2025-02-28T12:26:43.000Z","size":119979,"stargazers_count":34,"open_issues_count":9,"forks_count":19,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-29T01:12:34.456Z","etag":null,"topics":["appcelerator","axway","firebase","firebase-analytics","javascript","native","titanium"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hansemannn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["hansemannn","m1ga"]}},"created_at":"2017-10-15T21:35:40.000Z","updated_at":"2025-02-28T12:23:29.000Z","dependencies_parsed_at":"2024-11-28T15:42:54.488Z","dependency_job_id":null,"html_url":"https://github.com/hansemannn/titanium-firebase-analytics","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-firebase-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-firebase-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-firebase-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-firebase-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansemannn","download_url":"https://codeload.github.com/hansemannn/titanium-firebase-analytics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249152968,"owners_count":21221321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appcelerator","axway","firebase","firebase-analytics","javascript","native","titanium"],"created_at":"2024-11-28T15:30:08.703Z","updated_at":"2025-04-15T20:47:03.749Z","avatar_url":"https://github.com/hansemannn.png","language":"Objective-C","funding_links":["https://github.com/sponsors/hansemannn","https://github.com/sponsors/m1ga"],"categories":[],"sub_categories":[],"readme":"# Firebase Analytics - Titanium Module\nUse the native Firebase SDK in Axway Titanium. This repository is part of the [Titanium Firebase](https://github.com/hansemannn/titanium-firebase) project.\n\n⚠️ This module complies to the EU General Data Protection Regulation ([GDPR](https://www.eugdpr.org/)) regulation already.\nUse the `enabled` property to enable or disable Analytics and `resetAnalyticsData()` to make Cambridge Analytica angry 😙.\n\n## Supporting this effort\n\nThe whole Firebase support in Titanium is developed and maintained by the community (`@hansemannn` and `@m1ga`). To keep\nthis project maintained and be able to use the latest Firebase SDK's, please see the \"Sponsor\" button of this repository,\nthank you!\n\n## Requirements\n- [x] The [Firebase Core](https://github.com/hansemannn/titanium-firebase-core) module (iOS only)\n- [x] iOS: Titanium SDK 6.2.0+\n- [x] Android: Titanium SDK 7.0.0+\n\n## Installation\n\nIn general, make sure to follow the general instructions described in the [main project](https://github.com/hansemannn/titanium-firebase/blob/master/README.md#️-android-note).\n\n### iOS\n\nNo additional setup required for Firebase Analytics on iOS.\n\n## Android\n\nThere are a few additional requirements for Firebase Analytics on Android:\n\n1. Copy the following code under the `\u003capplication\u003e` tag of your tiapp.xml. Please note to replace\nall occurrences of `MY_PACKAGE_NAME` with your actual package name (= `\u003cid\u003e` in your tiapp.xml):\n\n```xml\n\u003candroid xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n\t\u003cmanifest\u003e\n\t\t\u003capplication\u003e\n\t\t\t\u003cservice android:name=\"com.google.android.gms.measurement.AppMeasurementService\" android:enabled=\"true\" android:exported=\"false\" /\u003e\n\n\t\t\t\u003cservice android:name=\"com.google.android.gms.measurement.AppMeasurementJobService\" android:permission=\"android.permission.BIND_JOB_SERVICE\" android:enabled=\"true\" android:exported=\"false\" /\u003e\n\n\t\t\t\u003cservice android:name=\"MY_PACKAGE_NAME.gcm.RegistrationIntentService\" android:exported=\"false\" /\u003e\n\n\t\t\t\u003creceiver android:name=\"com.google.android.gms.measurement.AppMeasurementReceiver\" android:enabled=\"true\"\u003e\n\t\t\t   \u003cintent-filter\u003e\n\t\t\t\t  \u003caction android:name=\"com.google.android.gms.measurement.UPLOAD\" /\u003e\n\t\t\t   \u003c/intent-filter\u003e\n\t\t\t\u003c/receiver\u003e\n\n\t\t\t\u003c!-- Only add the GCM-related tags if you are using push notifications as well --\u003e\n\t\t\t\u003cservice android:name=\"MY_PACKAGE_NAME.gcm.GcmIntentService\" android:exported=\"false\"\u003e\n\t\t\t   \u003cintent-filter\u003e\n\t\t\t\t  \u003caction android:name=\"com.google.android.c2dm.intent.RECEIVE\" /\u003e\n\t\t\t\t  \u003caction android:name=\"com.google.android.c2dm.intent.SEND\" /\u003e\n\t\t\t   \u003c/intent-filter\u003e\n\t\t\t\u003c/service\u003e\n\n\t\t\t\u003cservice android:name=\"MY_PACKAGE_NAME.gcm.GcmIDListenerService\" android:exported=\"false\"\u003e\n\t\t\t   \u003cintent-filter\u003e\n\t\t\t\t  \u003caction android:name=\"com.google.android.gms.iid.InstanceID\" /\u003e\n\t\t\t   \u003c/intent-filter\u003e\n\t\t\t\u003c/service\u003e\n\t\t\u003c/application\u003e\n\t\u003c/manifest\u003e\n\u003c/android\u003e\n```\n\n2. Create a file `strings.xml` that is located at:\n   - Alloy: `\u003cproject-dir\u003e/app/platform/android/res/values/strings.xml`\n   - Classic: `\u003cproject-dir\u003e/platform/android/res/values/strings.xml`\n\n   with your Firebase Application ID (mobilesdk_app_id from the JSON file) content:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cresources\u003e\n\t\u003cstring name=\"google_app_id\"\u003eYOUR_FIREBASE_APPLICATION_ID\u003c/string\u003e\n\u003c/resources\u003e\n```\n\n### Disable AD_ID\n\nIf you get a warning about AD_ID usage you can try the following tiapp.xml lines to remove it:\n\n```xml\n\u003cmanifest\u003e\n\t\u003capplication \u003e\n\t\t\u003cmeta-data android:name=\"google_analytics_adid_collection_enabled\" android:value=\"false\" /\u003e\n\t\t\u003cmeta-data android:name=\"google_analytics_default_allow_ad_personalization_signals\" android:value=\"false\" /\u003e\n\t\u003c/application\u003e\n\t\u003cuses-permission android:name=\"com.google.android.gms.permission.AD_ID\" tools:node=\"remove\" /\u003e\n\u003c/manifest\u003e\n```\nIt might impact you analytics data so only use it if you are sure you don't need it. Check [Google Support: Advertising ID](https://support.google.com/googleplay/android-developer/answer/6048248?hl=en) for more information.\n\n## Download\n- [x] [Stable release](https://github.com/hansemannn/titanium-firebase-analytics/releases)\n- [x] [![gitTio](http://hans-knoechel.de/shields/shield-gittio.svg?v2)](http://gitt.io/component/firebase.analytics)\n\n## API's\n\n### `FirebaseAnalytics`\n\n#### Methods\n\n##### `log(name, parameters)`\n  - `name` (String)\n  - `parameters` (Dictionary, optional)\n\nLogs an app event. The event can have up to 25 parameters. Events with the same name must\nhave the same parameters. Up to 500 event names are supported.\n\nMake sure to check the [Log Events](https://firebase.google.com/docs/analytics/android/events) docs to validate\n  that you are using a valid event name (1st parameter) and parameter structure (2nd event).\n\n##### `saveUserProperty(parameters)`\n  - `parameters` (Dictionary)\n    - `value` (String)\n    - `name` (String)\n\nSets a user property to a given value. Up to 25 user property names are supported. Once set, user\nproperty values persist throughout the app lifecycle and across sessions.\n\n##### `setScreenNameAndScreenClass(parameters)`\n  - `parameters` (Dictionary)\n    - `screenName` (String)\n    - `screenClass` (String, defaults to `TiController`)\n\nSets the current screen name, which specifies the current visual context in your app. This helps identify\nthe areas in your app where users spend their time and how they interact with your app.\n\n\n##### `resetAnalyticsData()` (iOS-only, on  Android requires /lib version \u003e 11.6.0)\n\nClears all analytics data for this app from the device and resets the app instance id.\n\n##### `fetchAppInstanceID(callback)`\n\nFetches the app instance ID.\n\n#### Properties\n\n##### `enabled` (Boolean, set)\n\nSets whether analytics collection is enabled for this app on this device. This setting is persisted across\napp sessions. By default it is enabled.\n\n##### `userID` (String, set)\n\nThe user ID to ascribe to the user of this app on this device, which must be\nnon-empty and no more than 256 characters long. Setting userID to `null` removes the user ID.\n\n## Example\n```js\n// Require the Firebase Core module (own project!)\nif (OS_IOS) {\n  var FirebaseCore = require('firebase.core');\n  FirebaseCore.configure();\n}\n\n// Require the Firebase Analytics module\nvar FirebaseAnalytics = require('firebase.analytics');\n\n// Get the App Instance ID\nTi.API.info('App Instance ID: ' + FirebaseAnalytics.appInstanceID);\n\n// Log to the Firebase console\nFirebaseAnalytics.log('My_Event', { /* Optional arguments */ });\n\n// Set user-property string\nFirebaseAnalytics.setUserPropertyString({\n  name: 'My_Name',\n  value: 'My Value'\n});\n\n// Set User-ID\nFirebaseAnalytics.userID = 'MyUserID';\n\n// Set screen-name  and screen-class\nFirebaseAnalytics.setScreenNameAndScreenClass({\n  screenName: 'ScreenName',\n  screenClass: 'ScreenClass'\n});\n\n// Toogle analytics on/off (default: on / true)\nFirebaseAnalytics.enabled = false;\n```\n\n## Update SDK's\n\n- [x] Android: Using Gradle command `gradle getDeps`\n- [x] iOS: Downloading the [latest framework](https://firebase.google.com/download/ios)\n\n## Build\n\n```js\ncd ios\nappc run -p [ios|android] --build-only\n```\n\n## Legal\n\nThis module is Copyright (c) 2017-Present by Hans Knöchel. All Rights Reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansemannn%2Ftitanium-firebase-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansemannn%2Ftitanium-firebase-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansemannn%2Ftitanium-firebase-analytics/lists"}