Remove firebase analytics

Sadly, even when firebase analytics is disabled, it still sends some
data to Google's servers and there seems to be no way to disable it.
GitJournal gives its users an option to disable all analytics, which
clearly can't be implemented as long as we use Firebase.

Therefore there are 2 options -
1. Remove the option of disabling all analytics
2. Remove firebase analytics.

I'm choosing option (2), as it seems wrong to remove the option to
disable analytics, as I know a number of users who have disabled
analytics.

Currently I'm mostly using analytics to measure how well the marketting
is doing, and to see which settings are being used. Disabling the
analytics would make this much much harder, but I guess it's a greater
push for me to find an alternative / create one.

Fixes #506
Related to #105
This commit is contained in:
Vishesh Handa
2021-06-07 12:21:41 +02:00
parent 47ec7ebf2b
commit 17dd93451f
7 changed files with 16 additions and 118 deletions

View File

@ -87,9 +87,6 @@ limitations under the License.
</activity>
<meta-data android:name="flutterEmbedding" android:value="2" />
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />
<meta-data android:name="google_analytics_ssaid_collection_enabled" android:value="false" />
<meta-data android:name="io.sentry.dsn" android:value="https://35f34dbec289435fbe16483faacf49a5@sentry.io/5168082" />
</application>
</manifest>

View File

@ -3,7 +3,6 @@ import 'dart:io' show Platform;
import 'package:flutter/material.dart';
import 'package:device_info/device_info.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:gitjournal/app.dart';
import 'package:gitjournal/error_reporting.dart';
@ -138,7 +137,7 @@ String _eventToString(Event e) {
}
class Analytics {
var firebase = FirebaseAnalytics();
// var firebase = FirebaseAnalytics();
bool enabled = false;
Future<void> log({
@ -148,7 +147,7 @@ class Analytics {
String name = _eventToString(e);
if (enabled) {
if (Platform.isAndroid || Platform.isIOS) {
await firebase.logEvent(name: name, parameters: parameters);
// await firebase.logEvent(name: name, parameters: parameters);
}
}
captureErrorBreadcrumb(name: name, parameters: parameters);
@ -157,7 +156,7 @@ class Analytics {
Future<void> setAnalyticsCollectionEnabled(bool enabled) async {
this.enabled = enabled;
if (Platform.isAndroid || Platform.isIOS) {
await firebase.setAnalyticsCollectionEnabled(enabled);
// await firebase.setAnalyticsCollectionEnabled(enabled);
}
}
@ -166,7 +165,7 @@ class Analytics {
return;
}
if (Platform.isAndroid || Platform.isIOS) {
await firebase.setCurrentScreen(screenName: screenName);
// await firebase.setCurrentScreen(screenName: screenName);
}
}
@ -178,7 +177,7 @@ class Analytics {
return;
}
if (Platform.isAndroid || Platform.isIOS) {
await firebase.setUserProperty(name: name, value: value);
// await firebase.setUserProperty(name: name, value: value);
}
}
}

View File

@ -444,15 +444,16 @@ class SettingsListState extends State<SettingsList> {
},
),
const SizedBox(height: 16.0),
SwitchListTile(
title: Text(tr('settings.usageStats')),
value: appSettings.collectUsageStatistics,
onChanged: (bool val) {
appSettings.collectUsageStatistics = val;
appSettings.save();
setState(() {});
},
),
// Disabled until we find a replacement for Firebase Analytics
// SwitchListTile(
// title: Text(tr('settings.usageStats')),
// value: appSettings.collectUsageStatistics,
// onChanged: (bool val) {
// appSettings.collectUsageStatistics = val;
// appSettings.save();
// setState(() {});
// },
// ),
SwitchListTile(
title: Text(tr('settings.crashReports')),
value: appSettings.collectCrashReports,

View File

@ -7,7 +7,6 @@ import Foundation
import bonsoir
import connectivity_macos
import firebase_core
import package_info
import package_info_plus_macos
import path_provider_macos
@ -18,7 +17,6 @@ import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
BonsoirPlugin.register(with: registry.registrar(forPlugin: "BonsoirPlugin"))
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))

View File

@ -4,44 +4,16 @@ PODS:
- connectivity_macos (0.0.1):
- FlutterMacOS
- Reachability
- Firebase/CoreOnly (7.3.0):
- FirebaseCore (= 7.3.0)
- firebase_core (1.0.3):
- Firebase/CoreOnly (~> 7.3.0)
- FlutterMacOS
- FirebaseCore (7.3.0):
- FirebaseCoreDiagnostics (~> 7.0)
- GoogleUtilities/Environment (~> 7.0)
- GoogleUtilities/Logger (~> 7.0)
- FirebaseCoreDiagnostics (7.10.0):
- GoogleDataTransport (~> 8.4)
- GoogleUtilities/Environment (~> 7.0)
- GoogleUtilities/Logger (~> 7.0)
- nanopb (~> 2.30908.0)
- FlutterMacOS (1.0.0)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- GoogleDataTransport (8.4.0):
- GoogleUtilities/Environment (~> 7.2)
- nanopb (~> 2.30908.0)
- PromisesObjC (~> 1.2)
- GoogleUtilities/Environment (7.3.1):
- PromisesObjC (~> 1.2)
- GoogleUtilities/Logger (7.3.1):
- GoogleUtilities/Environment
- nanopb (2.30908.0):
- nanopb/decode (= 2.30908.0)
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- package_info (0.0.1):
- FlutterMacOS
- package_info_plus_macos (0.0.1):
- FlutterMacOS
- path_provider_macos (0.0.1):
- FlutterMacOS
- PromisesObjC (1.2.12)
- Reachability (3.2)
- shared_preferences_macos (0.0.1):
- FlutterMacOS
@ -54,7 +26,6 @@ PODS:
DEPENDENCIES:
- bonsoir (from `Flutter/ephemeral/.symlinks/plugins/bonsoir/macos`)
- connectivity_macos (from `Flutter/ephemeral/.symlinks/plugins/connectivity_macos/macos`)
- firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- package_info (from `Flutter/ephemeral/.symlinks/plugins/package_info/macos`)
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`)
@ -65,14 +36,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
- FMDB
- GoogleDataTransport
- GoogleUtilities
- nanopb
- PromisesObjC
- Reachability
EXTERNAL SOURCES:
@ -80,8 +44,6 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/bonsoir/macos
connectivity_macos:
:path: Flutter/ephemeral/.symlinks/plugins/connectivity_macos/macos
firebase_core:
:path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos
FlutterMacOS:
:path: Flutter/ephemeral
package_info:
@ -100,19 +62,11 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
bonsoir: ed234bfe379db88e2b7b11381e0a2c93e022f3f7
connectivity_macos: 9f30e9d0e67a0bc08a0c563ee82310b51ca6e818
Firebase: 26223c695fe322633274198cb19dca8cb7e54416
firebase_core: 5c0a84649819db6738f6d159548762a2def9cb50
FirebaseCore: 4d3c72622ce0e2106aaa07bb4b2935ba2c370972
FirebaseCoreDiagnostics: 5662a3823ffcc0acbaa9a21ba5ed302fac634705
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GoogleDataTransport: cd9db2180fcecd8da1b561aea31e3e56cf834aa7
GoogleUtilities: e1d9ed4e544fc32a93e00e721400cbc3f377200d
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
package_info: 6eba2fd8d3371dda2d85c8db6fe97488f24b74b2
package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c
path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea

View File

@ -404,55 +404,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1"
firebase:
dependency: transitive
description:
name: firebase
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.1"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.0"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
firebase_core:
dependency: transitive
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
fixnum:
dependency: transitive
description:
@ -480,7 +431,7 @@ packages:
source: hosted
version: "0.6.0"
flutter_cache_manager:
dependency: "direct main"
dependency: transitive
description:
name: flutter_cache_manager
url: "https://pub.dartlang.org"

View File

@ -40,8 +40,6 @@ dependencies:
file_picker: ^3.0.1
filesystem_picker: ^2.0.0-nullsafety.0 # for directories
fimber: ^0.6.1
firebase_analytics: ^8.0.0
flutter_cache_manager: ^3.0.1
flutter_email_sender: ^5.0.0
flutter_emoji:
git: https://github.com/cek-cek/flutter-emoji