Compare commits
8 commits
7b358a84ef
...
c04f4661cd
| Author | SHA1 | Date | |
|---|---|---|---|
| c04f4661cd | |||
| 9e6403b0a9 | |||
| 2699b34bf8 | |||
| 44d04cde64 | |||
| d00bb4d3b1 | |||
| fcd16597ec | |||
| a6f4b9a1f1 | |||
| 59979fff42 |
9 changed files with 175 additions and 69 deletions
|
|
@ -46,6 +46,12 @@
|
|||
android:requestLegacyExternalStorage="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
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
|
|
|
|||
5
android/app/src/main/res/values/strings.xml
Normal file
5
android/app/src/main/res/values/strings.xml
Normal 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
BIN
ios/.DS_Store
vendored
Binary file not shown.
|
|
@ -1188,6 +1188,8 @@ PODS:
|
|||
- abseil/meta/type_traits
|
||||
- abseil/xcprivacy
|
||||
- abseil/xcprivacy (1.20240722.0)
|
||||
- app_tracking_transparency (0.0.1):
|
||||
- Flutter
|
||||
- BoringSSL-GRPC (0.0.37):
|
||||
- BoringSSL-GRPC/Implementation (= 0.0.37)
|
||||
- BoringSSL-GRPC/Interface (= 0.0.37)
|
||||
|
|
@ -1202,6 +1204,15 @@ PODS:
|
|||
- Flutter
|
||||
- device_info_plus (0.0.1):
|
||||
- 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/CoreOnly
|
||||
- FirebaseAuth (~> 11.15.0)
|
||||
|
|
@ -1487,9 +1498,11 @@ PODS:
|
|||
- FlutterMacOS
|
||||
|
||||
DEPENDENCIES:
|
||||
- app_tracking_transparency (from `.symlinks/plugins/app_tracking_transparency/ios`)
|
||||
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
|
||||
- cloud_firestore (from `.symlinks/plugins/cloud_firestore/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_core (from `.symlinks/plugins/firebase_core/ios`)
|
||||
- firebase_database (from `.symlinks/plugins/firebase_database/ios`)
|
||||
|
|
@ -1516,6 +1529,9 @@ SPEC REPOS:
|
|||
trunk:
|
||||
- abseil
|
||||
- BoringSSL-GRPC
|
||||
- FBAEMKit
|
||||
- FBSDKCoreKit
|
||||
- FBSDKCoreKit_Basics
|
||||
- Firebase
|
||||
- FirebaseAppCheckInterop
|
||||
- FirebaseAuth
|
||||
|
|
@ -1547,12 +1563,16 @@ SPEC REPOS:
|
|||
- RecaptchaInterop
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
app_tracking_transparency:
|
||||
:path: ".symlinks/plugins/app_tracking_transparency/ios"
|
||||
camera_avfoundation:
|
||||
:path: ".symlinks/plugins/camera_avfoundation/ios"
|
||||
cloud_firestore:
|
||||
:path: ".symlinks/plugins/cloud_firestore/ios"
|
||||
device_info_plus:
|
||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||
facebook_app_events:
|
||||
:path: ".symlinks/plugins/facebook_app_events/ios"
|
||||
firebase_auth:
|
||||
:path: ".symlinks/plugins/firebase_auth/ios"
|
||||
firebase_core:
|
||||
|
|
@ -1598,10 +1618,15 @@ EXTERNAL SOURCES:
|
|||
|
||||
SPEC CHECKSUMS:
|
||||
abseil: a05cc83bf02079535e17169a73c5be5ba47f714b
|
||||
app_tracking_transparency: 3d84f147f67ca82d3c15355c36b1fa6b66ca7c92
|
||||
BoringSSL-GRPC: dded2a44897e45f28f08ae87a55ee4bcd19bc508
|
||||
camera_avfoundation: 5675ca25298b6f81fa0a325188e7df62cc217741
|
||||
cloud_firestore: fdcc87898326e396d6ef6df543acf9b5c2034b95
|
||||
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
|
||||
facebook_app_events: 58a1b62fd50f6009907bd167fc26b3d043e97197
|
||||
FBAEMKit: 2a6b529993713c185b02bc36f8c91129bf78dfb0
|
||||
FBSDKCoreKit: 65d7f7a7d6fcc3aa6eb6e093ec737a4184fc6049
|
||||
FBSDKCoreKit_Basics: 7bc9d8fde8f70985fba2ed7c1d07e319f969a991
|
||||
Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e
|
||||
firebase_auth: 50af8366c87bb88c80ebeae62eb60189c7246b9b
|
||||
firebase_core: 995454a784ff288be5689b796deb9e9fa3601818
|
||||
|
|
|
|||
|
|
@ -2,68 +2,80 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>CAI App</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>cid_app</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>mailto</string>
|
||||
</array>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>LSSupportsOpeningDocumentsInPlace</key>
|
||||
<true/>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>La fotocamera è necessaria per scansionare il QR Code e importare i dati del sinistro.</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>La tua posizione serve per compilare automaticamente il luogo dell'incidente nel modulo.</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>La tua posizione serve per compilare il luogo dell'incidente anche se l'app è in background.</string>
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>Serve per salvare il modulo PDF o i disegni dei danni nel rullino.</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>Serve per allegare le foto dei danni al veicolo.</string>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UIFileSharingEnabled</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<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>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>CAI App</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>cid_app</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>mailto</string>
|
||||
<string>fbapi</string>
|
||||
<string>fb-messenger-share-api</string>
|
||||
</array>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>LSSupportsOpeningDocumentsInPlace</key>
|
||||
<true/>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>La fotocamera è necessaria per scansionare il QR Code e importare i dati del sinistro.</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>La tua posizione serve per compilare automaticamente il luogo dell'incidente nel modulo.</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>La tua posizione serve per compilare il luogo dell'incidente anche se l'app è in background.</string>
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>Serve per salvare il modulo PDF o i disegni dei danni nel rullino.</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>Serve per allegare le foto dei danni al veicolo.</string>
|
||||
|
||||
<key>FacebookAppID</key>
|
||||
<string>1323554676251293</string>
|
||||
<key>FacebookClientToken</key>
|
||||
<string>9e6e7ab503f27ff5e822a239e311f432</string>
|
||||
<key>FacebookDisplayName</key>
|
||||
<string>CAI Facile</string>
|
||||
|
||||
<key>NSUserTrackingUsageDescription</key>
|
||||
<string>Utilizziamo questi dati per fornirti annunci personalizzati e migliorare l'app.</string>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UIFileSharingEnabled</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<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>
|
||||
</plist>
|
||||
</plist>
|
||||
|
|
@ -1,9 +1,14 @@
|
|||
import 'dart:io'; // Aggiunto per il controllo Platform.isIOS
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_auth/firebase_auth.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)
|
||||
import 'firebase_options.dart';
|
||||
|
||||
|
|
@ -12,6 +17,9 @@ import 'scelta_lato.dart';
|
|||
import 'carro_attr.dart';
|
||||
import 'ps.dart';
|
||||
|
||||
// Istanza globale per tracciare gli eventi su Meta
|
||||
final facebookAppEvents = FacebookAppEvents();
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
|
|
@ -90,6 +98,35 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
super.initState();
|
||||
// Al primo avvio puliamo tutto
|
||||
_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
|
||||
|
|
@ -125,8 +162,6 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
// 1. Sfondo Base (Mappa)
|
||||
const Positioned.fill(child: BackgroundImage()),
|
||||
|
||||
|
||||
|
||||
// Contenuto
|
||||
SafeArea(
|
||||
child: Center(
|
||||
|
|
@ -148,6 +183,10 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
onTap: () async {
|
||||
// Reset esplicito prima di iniziare
|
||||
await _resetCompleto();
|
||||
|
||||
// Logghiamo l'inizio di una compilazione su Meta
|
||||
facebookAppEvents.logEvent(name: 'cai_start_compilation');
|
||||
|
||||
if (context.mounted) {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
|
@ -170,6 +209,7 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
icon: Icons.support_agent,
|
||||
baseColor: Colors.red.shade800,
|
||||
onTap: () {
|
||||
facebookAppEvents.logEvent(name: 'open_carro_attrezzi');
|
||||
Navigator.push(context, MaterialPageRoute(builder: (c) => const CarroAttrezziScreen()));
|
||||
},
|
||||
),
|
||||
|
|
@ -183,6 +223,7 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
icon: Icons.local_hospital_outlined,
|
||||
baseColor: Colors.green.shade800,
|
||||
onTap: () {
|
||||
facebookAppEvents.logEvent(name: 'open_pronto_soccorso');
|
||||
Navigator.push(context, MaterialPageRoute(builder: (c) => const ProntoSoccorsoScreen()));
|
||||
},
|
||||
),
|
||||
|
|
|
|||
|
|
@ -470,5 +470,4 @@ class _ScambioDatiScreenState extends State<ScambioDatiScreen> with SingleTicker
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// Test di sincronizzazione forzata ore 22:40
|
||||
}
|
||||
16
pubspec.lock
16
pubspec.lock
|
|
@ -9,6 +9,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -241,6 +249,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ name: cid_app
|
|||
description: "Applicazione per la compilazione assistita del modulo CAI/CID digitale."
|
||||
publish_to: 'none'
|
||||
|
||||
version: 1.0.5+3
|
||||
version: 1.0.7+6
|
||||
|
||||
environment:
|
||||
sdk: '>=3.10.0 <4.0.0'
|
||||
|
|
@ -67,6 +67,8 @@ dependencies:
|
|||
device_info_plus: ^12.3.0
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
facebook_app_events: ^0.24.0
|
||||
app_tracking_transparency: ^2.0.6+1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
|
|||
Loading…
Reference in a new issue