what is difference between debug mode and release mode when develope flutter with app tracking transparency?

35 views Asked by At
  • I develope flutter iOS project but there are one bug. I can see dialog when I run debug mode but If I run project by release mode I can't see any dialog

  • here is my code (this is code is default flutter project but I added only AppTrackingTransparency.req)

void main() async{
  WidgetsFlutterBinding.ensureInitialized();
  final TrackingStatus status = await AppTrackingTransparency.requestTrackingAuthorization();
  print("traking status $status");
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  Future<void> _initApp() async{}

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: _initApp(),
      builder: (context, snapshot) {
        if (snapshot.connectionState == ConnectionState.done) {
          return MaterialApp(
            ...

  • I'd appreciate your help. Thank you.
0

There are 0 answers