fix: added user tracking in ios
This commit is contained in:
parent
6d205dd99c
commit
ae0fe2f75f
|
@ -1,4 +1,6 @@
|
|||
PODS:
|
||||
- app_tracking_transparency (0.0.1):
|
||||
- Flutter
|
||||
- awesome_notifications (0.9.3):
|
||||
- Flutter
|
||||
- IosAwnCore (~> 0.9.3)
|
||||
|
@ -235,6 +237,7 @@ PODS:
|
|||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- app_tracking_transparency (from `.symlinks/plugins/app_tracking_transparency/ios`)
|
||||
- awesome_notifications (from `.symlinks/plugins/awesome_notifications/ios`)
|
||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
|
@ -285,6 +288,8 @@ SPEC REPOS:
|
|||
- Toast
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
app_tracking_transparency:
|
||||
:path: ".symlinks/plugins/app_tracking_transparency/ios"
|
||||
awesome_notifications:
|
||||
:path: ".symlinks/plugins/awesome_notifications/ios"
|
||||
connectivity_plus:
|
||||
|
@ -331,6 +336,7 @@ EXTERNAL SOURCES:
|
|||
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
app_tracking_transparency: e169b653478da7bb15a6c61209015378ca73e375
|
||||
awesome_notifications: 66d28ab7174ca2823b04d275cb043e0a4a3eb9cf
|
||||
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
|
||||
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
|
||||
|
|
|
@ -91,5 +91,7 @@
|
|||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>NSUserTrackingUsageDescription</key>
|
||||
<string>This identifier will be used for application crash diagnostics for internal development use only.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -15,12 +15,15 @@ import 'package:hub/flutter_flow/internationalization.dart';
|
|||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
|
||||
|
||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
Future<void> initializeApp() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
final status = await AppTrackingTransparency.requestTrackingAuthorization();
|
||||
|
||||
await Firebase.initializeApp();
|
||||
await FirebaseMessagingService().initNotifications();
|
||||
await NotificationService.initialize();
|
||||
|
@ -69,12 +72,50 @@ class _AppState extends State<App> {
|
|||
super.initState();
|
||||
|
||||
FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
|
||||
// WidgetsFlutterBinding.ensureInitialized().addPostFrameCallback((_) => initializeTracking());
|
||||
|
||||
_appStateNotifier = AppStateNotifier.instance;
|
||||
_router = createRouter(_appStateNotifier);
|
||||
Future.delayed(const Duration(milliseconds: 1000),
|
||||
() => setState(() => _appStateNotifier.stopShowingSplashImage()));
|
||||
}
|
||||
//
|
||||
// Future<void> showCustomTrackingDialog(BuildContext context) async {
|
||||
// await showDialog<void>(
|
||||
// context: context,
|
||||
// builder: (context) => AlertDialog(
|
||||
// title: const Text('Dear User'),
|
||||
// content: const Text(
|
||||
// 'We care about your privacy and data security. We keep this app free by showing ads. '
|
||||
// 'Can we continue to use your data to tailor ads for you?\n\nYou can change your choice anytime in the app settings. '
|
||||
// 'Our partners will collect data and use a unique identifier on your device to show you ads.',
|
||||
// ),
|
||||
// actions: [
|
||||
// TextButton(
|
||||
// onPressed: () => Navigator.pop(context),
|
||||
// child: const Text('Continue'),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// Future<void> initializeTracking() async {
|
||||
// if (await AppTrackingTransparency.trackingAuthorizationStatus ==
|
||||
// TrackingStatus.notDetermined) {
|
||||
// // Show a custom explainer dialog before the system dialog
|
||||
// await showCustomTrackingDialog(context);
|
||||
// // Wait for dialog popping animation
|
||||
// await Future.delayed(const Duration(milliseconds: 200));
|
||||
// // Request system's tracking authorization dialog
|
||||
// await AppTrackingTransparency.requestTrackingAuthorization();
|
||||
// }
|
||||
//
|
||||
// final uuid = await AppTrackingTransparency.getAdvertisingIdentifier();
|
||||
// log("UUID de Publicidade: $uuid");
|
||||
// }
|
||||
|
||||
|
||||
|
||||
void setLocale(String language) {
|
||||
setState(() => _locale = createLocale(language));
|
||||
|
|
|
@ -9,6 +9,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.37"
|
||||
app_tracking_transparency:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: app_tracking_transparency
|
||||
sha256: "64d9745931e565790abdea91b518ac8dc3cebe6d0d0aaf7119343271b983259a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.6"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -3,7 +3,7 @@ description: A new Flutter project.
|
|||
|
||||
publish_to: "none"
|
||||
|
||||
version: 1.0.0+5
|
||||
version: 1.0.0+6
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
@ -96,6 +96,7 @@ dependencies:
|
|||
permission_handler: ^11.3.1
|
||||
firebase_crashlytics: ^4.0.1
|
||||
awesome_notifications: ^0.9.3+1
|
||||
app_tracking_transparency: ^2.0.6
|
||||
|
||||
dependency_overrides:
|
||||
http: 1.2.1
|
||||
|
|
Loading…
Reference in New Issue