Skip to content

Commit feeb25b

Browse files
committed
Add Firebase social login info
1 parent d3f3ef3 commit feeb25b

File tree

6 files changed

+92
-1
lines changed

6 files changed

+92
-1
lines changed

docs/integrations/firebase.md

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Firebase
44
description: Learn how to connect your Dreamflow app with Firebase to enable powerful backend features such as authentication, real-time databases, analytics, and more.
55
tags: [Firebase, Integration, Dreamflow, Backend]
66
sidebar_position: 1
7-
toc_max_heading_level: 4
7+
toc_max_heading_level: 3
88
keywords: [Firebase, Integration, Dreamflow, Backend]
99
---
1010

@@ -246,6 +246,97 @@ Here’s an example of enabling email/password authentication:
246246
</div>
247247
<p></p>
248248

249+
### Google Authentication
250+
251+
To configure Google Sign-In for your app, follow these steps:
252+
253+
#### 1. Enable Google Authentication in Firebase Console
254+
255+
In the **Firebase Console**, go to **Authentication > Sign-in method**, select **Google**, and enable it. Click **Save** to confirm.
256+
257+
#### 2. Add SHA-1 Key for Android
258+
259+
For Android apps, generate your SHA-1 key by following the instructions in the [Google Developer Guide](https://developers.google.com/android/guides/client-auth). Then, open the **Firebase Console > Project Settings**, scroll to **Your Apps** section, select your Android app, and under **SHA certificate fingerprints**, click **Add fingerprint**. Paste the SHA-1 key and click **Save**.
260+
261+
![add-sha-1-key.avif](imgs/add-sha-1-key.avif)
262+
263+
#### 3. Update Firebase Configuration Files
264+
265+
After enabling Google Authentication, download the latest Firebase configuration files, i.e., `google-services.json` for Android and `GoogleService-Info.plist` for iOS, from the Firebase Console, and then upload these files to your Dreamflow app at the following location:
266+
267+
- Place the `google-services.json` file inside your project at `android/app/`.
268+
- Place the `GoogleService-Info.plist` file inside `ios/Runner/`.
269+
270+
![update-firebase-configuration-file.avif](imgs/update-firebase-configuration-file.avif)
271+
272+
#### 4. Add Google Authentication Code
273+
274+
You can add the Google sign-in code manually or let the Dreamflow Agent generate it for you. Here’s the **sample agent prompt** you can try:
275+
276+
```jsx
277+
Generate Google Sign-In authentication code for both mobile and web using the latest versions of firebase_auth and google_sign_in Dart packages.
278+
```
279+
#### 5. Add Authorized Domain
280+
281+
If you’re building for the web and want to test authentication while running your app in Dreamflow, follow the steps in the [Add Authorized Domain](#add-authorized-domain) section to add your Dreamflow preview domain to the Authorized Domains list in the Firebase Console.
282+
283+
### Facebook Authentication
284+
285+
To enable Facebook login in your app, follow the steps below:
286+
287+
#### 1. Set Up a Facebook Developer App
288+
289+
Before getting started, create and configure your [**Facebook Developer App**](https://developers.facebook.com/apps/). During setup, enable the **Facebook Login** product and complete the basic configuration.
290+
291+
#### 2. Enable Facebook Authentication in Firebase Console
292+
293+
1. In the **Firebase Console**, go to **Authentication > Sign-in method**. Select **Facebook** and enable it.
294+
2. You’ll be prompted to enter your **App ID** and **App Secret**, which you can find in your Facebook Developer App Dashboard under **App** **Settings > Basic**.
295+
296+
![add-app-details.avif](imgs/add-app-details.avif)
297+
298+
3. Copy the **OAuth Redirect URI** displayed in Firebase and add it to your Facebook app settings under **Facebook Login > Settings > Valid OAuth Redirect URIs**.
299+
300+
![add-facebook-uri.avif](imgs/add-facebook-uri.avif)
301+
302+
4. Click **Save** in Firebase once everything is configured.
303+
304+
#### 3. Add Facebook Authentication Code
305+
306+
You can add the Facebook sign-in code manually or let the Dreamflow Agent generate it for you. Here’s the **sample agent prompt** you can try:
307+
308+
```jsx
309+
Generate Facebook authentication code for both mobile and web using the latest versions of firebase_auth and flutter_facebook_auth Dart packages.
310+
```
311+
312+
#### 4. Configure Platform-Specific Code
313+
314+
Once the authentication code is added, you’ll need to configure your project for **Android** and **iOS** to ensure the Facebook sign-in works properly.
315+
316+
- **For Android:** Follow the setup guide in the [Facebook Android configuration documentation](https://facebook.meedu.app/docs/7.x.x/android).
317+
- **For iOS:** Refer to the [Facebook iOS configuration guide](https://facebook.meedu.app/docs/7.x.x/ios).
318+
319+
#### 5. Add Authorized Domain
320+
321+
If you’re building for the web and want to test authentication while running your app in Dreamflow, follow the steps in the [Add Authorized Domain](#add-authorized-domain) section to add your Dreamflow preview domain to the **Authorized Domains** list in the Firebase Console.
322+
323+
### Add Authorized Domain
324+
325+
If you’re building for the web and want to test authentication while running your app in Dreamflow, you must add your Dreamflow preview domain to the **Authorized Domains** list in the Firebase Console.
326+
327+
To add authorized domain:
328+
329+
1. Open **Developer Tools** in your browser; press **`Ctrl + Shift + J`** (Windows/Linux) or **`Cmd + Option + J`** (Mac) to open it directly in **Google Chrome**.
330+
2. In the **Console** tab, press **Ctrl + F** (or **Cmd + F** on Mac) and search for `dreamflow.cloud`.
331+
Locate the log entry that contains a URL like: `wss://summer-firefly-vuh34ynj.mum0.dreamflow.cloud`
332+
3. Copy the domain part — for example: `summer-firefly-vuh34ynj.mum0.dreamflow.cloud`
333+
4. Go to the **Firebase Console****Authentication****Settings****Authorized Domains**. Click **Add Domain**, paste the copied Dreamflow domain, and click **Save**.
334+
5. Reload and test your app.
335+
336+
![add-authorized-domain](imgs/add-authorized-domain.avif)
337+
338+
339+
249340
## Add Sample Data to Firebase
250341

251342
Dreamflow lets you add sample data to your Firebase project for easier development and testing. The generated data follows your app’s schema, so you can quickly check how your app works with populated users, collections, and documents.
115 KB
Binary file not shown.
191 KB
Binary file not shown.
181 KB
Binary file not shown.
234 KB
Binary file not shown.
177 KB
Binary file not shown.

0 commit comments

Comments
 (0)