How to initialise Firebase in Flutter for IOS

Viewed 103

I want to initialised firebase for IOS. For receiving push notification in my Flutter App.

  if (Platform.isAndroid)
    {
      await Firebase.initializeApp(),
    }

For Android I am using this method for initialising the firebase. I can't understand how it implement for IOS. When ever it is used same as for the IOS is shows errors.

void main() async => {
      WidgetsFlutterBinding.ensureInitialized(),
      if (Platform.isAndroid)
        {
          await Firebase.initializeApp(),
        },
      SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
          .then((_) {
        runApp(new MyApp());
      })
    };

No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core

1 Answers

Have you try what they say in the documentation?

  if (Platform.isAndroid)
    {
      WidgetsFlutterBinding.ensureInitialized();// add this line
      await Firebase.initializeApp(),
    }
Related