title: Open Facebook app with url_launcher package in Flutter
body: <p>I am trying to open the Facebook app on a company page in Flutter but it keeps opening it in the web browser instead.</p>
  <p>It's just a simple widget that outputs a row of social media icons from a list:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:url_launcher/url_launcher.dart';
  
  class SocialMediaLinks extends StatelessWidget {
    SocialMediaLinks({Key? key}) : super(key: key);
  
    final List&lt;Map&lt;dynamic, dynamic&gt;&gt; icons = [
      {
        'name': 'twitter',
        'launchUrl': 'twitter://PAGENAME',
        'backupUrl': 'https://twitter.com/PAGENAME',
      },
      {
        'name': 'facebook',
        'launchUrl': 'fb://page/PAGEID',
        'backupUrl': 'https://www.facebook.com/PAGENAME',
      },
      {
        'name': 'instagram',
        'launchUrl': 'instagram://PAGENAME',
        'backupUrl': 'https://www.instagram.com/PAGENAME',
      }
    ];
  
    @override
    Widget build(BuildContext context) {
      return Row(
        children: [
          for (Map i in icons)
            IconButton(
              onPressed: () async {
                await canLaunch(i['launchUrl'])
                    ? launch(
                        i['launchUrl'],
                        forceSafariVC: false,
                        forceWebView: false,
                      )
                    : launch(
                        i['backupUrl'],
                        forceSafariVC: false,
                        forceWebView: false,
                      );
              },
              splashRadius: 30.0,
              iconSize: 38.0,
              icon: Image.asset(
                &quot;assets/images/icons/${i['name']}.png&quot;,
                color: Colors.white,
              ),
            ),
        ],
      );
    }
  }
  </code></pre>
  <p>Twitter and Instagram work and open in their apps but Facebook still only opens in the web browser. I've tried tonnes of solutions on stackoverflow but to no avail. Am I missing something?</p>
  <p>Thanks.</p>