Compare commits

...

8 commits

Author SHA1 Message Date
c04f4661cd Auto-sync: 20260310_204548 2026-03-10 20:45:48 +01:00
9e6403b0a9 Auto-sync: 20260308_220001 2026-03-08 22:00:01 +01:00
2699b34bf8 Auto-sync: 20260308_210000 2026-03-08 21:00:01 +01:00
44d04cde64 Auto-sync: 20260308_200000 2026-03-08 20:00:01 +01:00
d00bb4d3b1 Auto-sync: 20260308_190000 2026-03-08 19:00:01 +01:00
fcd16597ec Auto-sync: 20260305_140000 2026-03-05 14:00:01 +01:00
a6f4b9a1f1 Auto-sync: 20260305_130001 2026-03-05 13:00:01 +01:00
59979fff42 Auto-sync: 20260304_230000 2026-03-04 23:00:01 +01:00
9 changed files with 175 additions and 69 deletions

View file

@ -46,6 +46,12 @@
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"> android:usesCleartextTraffic="true">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="@string/facebook_client_token"/>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="facebook_app_id">1323554676251293</string>
<string name="facebook_client_token">9e6e7ab503f27ff5e822a239e311f432</string>
</resources>

BIN
ios/.DS_Store vendored

Binary file not shown.

View file

@ -1188,6 +1188,8 @@ PODS:
- abseil/meta/type_traits - abseil/meta/type_traits
- abseil/xcprivacy - abseil/xcprivacy
- abseil/xcprivacy (1.20240722.0) - abseil/xcprivacy (1.20240722.0)
- app_tracking_transparency (0.0.1):
- Flutter
- BoringSSL-GRPC (0.0.37): - BoringSSL-GRPC (0.0.37):
- BoringSSL-GRPC/Implementation (= 0.0.37) - BoringSSL-GRPC/Implementation (= 0.0.37)
- BoringSSL-GRPC/Interface (= 0.0.37) - BoringSSL-GRPC/Interface (= 0.0.37)
@ -1202,6 +1204,15 @@ PODS:
- Flutter - Flutter
- device_info_plus (0.0.1): - device_info_plus (0.0.1):
- Flutter - Flutter
- facebook_app_events (0.24.0):
- FBSDKCoreKit (~> 18.0)
- Flutter
- FBAEMKit (18.0.3):
- FBSDKCoreKit_Basics (= 18.0.3)
- FBSDKCoreKit (18.0.3):
- FBAEMKit (= 18.0.3)
- FBSDKCoreKit_Basics (= 18.0.3)
- FBSDKCoreKit_Basics (18.0.3)
- Firebase/Auth (11.15.0): - Firebase/Auth (11.15.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseAuth (~> 11.15.0) - FirebaseAuth (~> 11.15.0)
@ -1487,9 +1498,11 @@ PODS:
- FlutterMacOS - FlutterMacOS
DEPENDENCIES: DEPENDENCIES:
- app_tracking_transparency (from `.symlinks/plugins/app_tracking_transparency/ios`)
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`) - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) - cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- facebook_app_events (from `.symlinks/plugins/facebook_app_events/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_database (from `.symlinks/plugins/firebase_database/ios`) - firebase_database (from `.symlinks/plugins/firebase_database/ios`)
@ -1516,6 +1529,9 @@ SPEC REPOS:
trunk: trunk:
- abseil - abseil
- BoringSSL-GRPC - BoringSSL-GRPC
- FBAEMKit
- FBSDKCoreKit
- FBSDKCoreKit_Basics
- Firebase - Firebase
- FirebaseAppCheckInterop - FirebaseAppCheckInterop
- FirebaseAuth - FirebaseAuth
@ -1547,12 +1563,16 @@ SPEC REPOS:
- RecaptchaInterop - RecaptchaInterop
EXTERNAL SOURCES: EXTERNAL SOURCES:
app_tracking_transparency:
:path: ".symlinks/plugins/app_tracking_transparency/ios"
camera_avfoundation: camera_avfoundation:
:path: ".symlinks/plugins/camera_avfoundation/ios" :path: ".symlinks/plugins/camera_avfoundation/ios"
cloud_firestore: cloud_firestore:
:path: ".symlinks/plugins/cloud_firestore/ios" :path: ".symlinks/plugins/cloud_firestore/ios"
device_info_plus: device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios" :path: ".symlinks/plugins/device_info_plus/ios"
facebook_app_events:
:path: ".symlinks/plugins/facebook_app_events/ios"
firebase_auth: firebase_auth:
:path: ".symlinks/plugins/firebase_auth/ios" :path: ".symlinks/plugins/firebase_auth/ios"
firebase_core: firebase_core:
@ -1598,10 +1618,15 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
abseil: a05cc83bf02079535e17169a73c5be5ba47f714b abseil: a05cc83bf02079535e17169a73c5be5ba47f714b
app_tracking_transparency: 3d84f147f67ca82d3c15355c36b1fa6b66ca7c92
BoringSSL-GRPC: dded2a44897e45f28f08ae87a55ee4bcd19bc508 BoringSSL-GRPC: dded2a44897e45f28f08ae87a55ee4bcd19bc508
camera_avfoundation: 5675ca25298b6f81fa0a325188e7df62cc217741 camera_avfoundation: 5675ca25298b6f81fa0a325188e7df62cc217741
cloud_firestore: fdcc87898326e396d6ef6df543acf9b5c2034b95 cloud_firestore: fdcc87898326e396d6ef6df543acf9b5c2034b95
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
facebook_app_events: 58a1b62fd50f6009907bd167fc26b3d043e97197
FBAEMKit: 2a6b529993713c185b02bc36f8c91129bf78dfb0
FBSDKCoreKit: 65d7f7a7d6fcc3aa6eb6e093ec737a4184fc6049
FBSDKCoreKit_Basics: 7bc9d8fde8f70985fba2ed7c1d07e319f969a991
Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e
firebase_auth: 50af8366c87bb88c80ebeae62eb60189c7246b9b firebase_auth: 50af8366c87bb88c80ebeae62eb60189c7246b9b
firebase_core: 995454a784ff288be5689b796deb9e9fa3601818 firebase_core: 995454a784ff288be5689b796deb9e9fa3601818

View file

@ -2,68 +2,80 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>CAI App</string> <string>CAI App</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>cid_app</string> <string>cid_app</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string> <string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>mailto</string> <string>mailto</string>
</array> <string>fbapi</string>
<key>LSRequiresIPhoneOS</key> <string>fb-messenger-share-api</string>
<true/> </array>
<key>LSSupportsOpeningDocumentsInPlace</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSCameraUsageDescription</key> <key>LSSupportsOpeningDocumentsInPlace</key>
<string>La fotocamera è necessaria per scansionare il QR Code e importare i dati del sinistro.</string> <true/>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>La tua posizione serve per compilare automaticamente il luogo dell'incidente nel modulo.</string> <string>La fotocamera è necessaria per scansionare il QR Code e importare i dati del sinistro.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string>La tua posizione serve per compilare il luogo dell'incidente anche se l'app è in background.</string> <string>La tua posizione serve per compilare automaticamente il luogo dell'incidente nel modulo.</string>
<key>NSPhotoLibraryAddUsageDescription</key> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Serve per salvare il modulo PDF o i disegni dei danni nel rullino.</string> <string>La tua posizione serve per compilare il luogo dell'incidente anche se l'app è in background.</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryAddUsageDescription</key>
<string>Serve per allegare le foto dei danni al veicolo.</string> <string>Serve per salvare il modulo PDF o i disegni dei danni nel rullino.</string>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>NSPhotoLibraryUsageDescription</key>
<true/> <string>Serve per allegare le foto dei danni al veicolo.</string>
<key>UIFileSharingEnabled</key>
<true/> <key>FacebookAppID</key>
<key>UILaunchStoryboardName</key> <string>1323554676251293</string>
<string>LaunchScreen</string> <key>FacebookClientToken</key>
<key>UIMainStoryboardFile</key> <string>9e6e7ab503f27ff5e822a239e311f432</string>
<string>Main</string> <key>FacebookDisplayName</key>
<key>UISupportedInterfaceOrientations</key> <string>CAI Facile</string>
<array>
<string>UIInterfaceOrientationPortrait</string> <key>NSUserTrackingUsageDescription</key>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>Utilizziamo questi dati per fornirti annunci personalizzati e migliorare l'app.</string>
<string>UIInterfaceOrientationLandscapeRight</string> <key>UIApplicationSupportsIndirectInputEvents</key>
</array> <true/>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UIFileSharingEnabled</key>
<array> <true/>
<string>UIInterfaceOrientationPortrait</string> <key>UILaunchStoryboardName</key>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <string>LaunchScreen</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <key>UIMainStoryboardFile</key>
<string>UIInterfaceOrientationLandscapeRight</string> <string>Main</string>
</array> <key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict> </dict>
</plist> </plist>

View file

@ -1,9 +1,14 @@
import 'dart:io'; // Aggiunto per il controllo Platform.isIOS
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
// --- LIBRERIE META SDK E TRACCIAMENTO APPLE ---
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
import 'package:facebook_app_events/facebook_app_events.dart';
// IMPORTANTE: Assicurati che questo file esista (generato da flutterfire configure) // IMPORTANTE: Assicurati che questo file esista (generato da flutterfire configure)
import 'firebase_options.dart'; import 'firebase_options.dart';
@ -12,6 +17,9 @@ import 'scelta_lato.dart';
import 'carro_attr.dart'; import 'carro_attr.dart';
import 'ps.dart'; import 'ps.dart';
// Istanza globale per tracciare gli eventi su Meta
final facebookAppEvents = FacebookAppEvents();
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
@ -90,6 +98,35 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
super.initState(); super.initState();
// Al primo avvio puliamo tutto // Al primo avvio puliamo tutto
_resetCompleto(); _resetCompleto();
// --- NUOVO CODICE: TRACCIAMENTO APPLE ---
// Lancia la richiesta di tracciamento appena la UI è pronta e visibile
WidgetsBinding.instance.addPostFrameCallback((_) {
_richiediTracciamentoApple();
});
}
// --- NUOVO METODO PER IL POPUP APPLE E EVENTI META ---
Future<void> _richiediTracciamentoApple() async {
// Il popup serve ESCLUSIVAMENTE su iOS
if (Platform.isIOS) {
final TrackingStatus status = await AppTrackingTransparency.trackingAuthorizationStatus;
// Se l'utente non ha ancora fatto una scelta (è il primissimo avvio)
if (status == TrackingStatus.notDetermined) {
// Pausa vitale: Apple boccia le app se il popup appare prima che lo schermo sia ben visibile
await Future.delayed(const Duration(milliseconds: 500));
// Mostra il popup di sistema all'utente
await AppTrackingTransparency.requestTrackingAuthorization();
// Logga l'evento della prima apertura su Facebook
facebookAppEvents.logEvent(name: 'app_opened_first_time');
}
} else {
// Su Android non c'è il blocco ATT, possiamo loggare liberamente l'apertura
facebookAppEvents.logEvent(name: 'app_opened_android');
}
} }
// Metodo centralizzato per reset e orientamento // Metodo centralizzato per reset e orientamento
@ -125,8 +162,6 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
// 1. Sfondo Base (Mappa) // 1. Sfondo Base (Mappa)
const Positioned.fill(child: BackgroundImage()), const Positioned.fill(child: BackgroundImage()),
// Contenuto // Contenuto
SafeArea( SafeArea(
child: Center( child: Center(
@ -148,6 +183,10 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
onTap: () async { onTap: () async {
// Reset esplicito prima di iniziare // Reset esplicito prima di iniziare
await _resetCompleto(); await _resetCompleto();
// Logghiamo l'inizio di una compilazione su Meta
facebookAppEvents.logEvent(name: 'cai_start_compilation');
if (context.mounted) { if (context.mounted) {
Navigator.push( Navigator.push(
context, context,
@ -170,6 +209,7 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
icon: Icons.support_agent, icon: Icons.support_agent,
baseColor: Colors.red.shade800, baseColor: Colors.red.shade800,
onTap: () { onTap: () {
facebookAppEvents.logEvent(name: 'open_carro_attrezzi');
Navigator.push(context, MaterialPageRoute(builder: (c) => const CarroAttrezziScreen())); Navigator.push(context, MaterialPageRoute(builder: (c) => const CarroAttrezziScreen()));
}, },
), ),
@ -183,6 +223,7 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
icon: Icons.local_hospital_outlined, icon: Icons.local_hospital_outlined,
baseColor: Colors.green.shade800, baseColor: Colors.green.shade800,
onTap: () { onTap: () {
facebookAppEvents.logEvent(name: 'open_pronto_soccorso');
Navigator.push(context, MaterialPageRoute(builder: (c) => const ProntoSoccorsoScreen())); Navigator.push(context, MaterialPageRoute(builder: (c) => const ProntoSoccorsoScreen()));
}, },
), ),

View file

@ -470,5 +470,4 @@ class _ScambioDatiScreenState extends State<ScambioDatiScreen> with SingleTicker
), ),
); );
} }
} }
// Test di sincronizzazione forzata ore 22:40

View file

@ -9,6 +9,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.59" version: "1.3.59"
app_tracking_transparency:
dependency: "direct main"
description:
name: app_tracking_transparency
sha256: "1f71f4d8402552fbf8b191d4edab301f233c1af794878b7bc56c708470ffd74c"
url: "https://pub.dev"
source: hosted
version: "2.0.6+1"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@ -241,6 +249,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.0.3" version: "5.0.3"
facebook_app_events:
dependency: "direct main"
description:
name: facebook_app_events
sha256: "3658a3e6983c23c1c1a52eb553b1be84816abd57c186aabe9bc538a4bfac2ed6"
url: "https://pub.dev"
source: hosted
version: "0.24.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:

View file

@ -2,7 +2,7 @@ name: cid_app
description: "Applicazione per la compilazione assistita del modulo CAI/CID digitale." description: "Applicazione per la compilazione assistita del modulo CAI/CID digitale."
publish_to: 'none' publish_to: 'none'
version: 1.0.5+3 version: 1.0.7+6
environment: environment:
sdk: '>=3.10.0 <4.0.0' sdk: '>=3.10.0 <4.0.0'
@ -67,6 +67,8 @@ dependencies:
device_info_plus: ^12.3.0 device_info_plus: ^12.3.0
flutter_localizations: flutter_localizations:
sdk: flutter sdk: flutter
facebook_app_events: ^0.24.0
app_tracking_transparency: ^2.0.6+1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: