简体   繁体   中英

How can i user second firebase project in my flutter app?

I am working in project which has already built and has a firebase project but now I want to add social authentication of Twitter into this app for which I have to create another firebase project because i don't have the access to first firebase project but I don't know how to connect second firebase project in the same app. How to connect firebase project to the same app. And my second question is: Can we do Twitter authentication without using firebase? if yes then how?

While not yet documented specifically for Flutter, the process is very similar for all supported platforms and documented in using multiple projects in your application . The crux is that you create a separate FirebaseApp instance for each project, and then access the services for the correct project through the corresponding instance.

For Flutter, the code would look something like this:

var app1 = await Firebase.initializeApp(
  options: const FirebaseOptions(
    apiKey: '...',
    appId: '...',
    ...
  )
);
var app2 = await Firebase.initializeApp(
  options: const FirebaseOptions(
    apiKey: '...',
    appId: '...',
    ...
  )
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM