Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/title-validation.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See https://github.com/amannn/action-semantic-pull-request
name: 'PR Title is Conventional'
name: "PR Title is Conventional"

on:
pull_request:
Expand Down Expand Up @@ -33,6 +33,3 @@ jobs:
revert
style
test
subjectPattern: ^[A-Z].+$
subjectPatternError: |
The subject of the PR must begin with an uppercase letter.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bootstrap:
@melos bs

.PHONY: bootstrap
98 changes: 98 additions & 0 deletions packages/supabase_flutter/example/FACEBOOK_AUTH_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Facebook Authentication Setup

This guide explains how to set up Facebook authentication in the Supabase Examples app.

## Prerequisites

1. A Facebook Developer account
2. A Facebook App created in the Facebook Developer Console
3. Supabase project with Facebook OAuth configured

## Setup Steps

### 1. Facebook Developer Console Configuration

1. Go to [Facebook Developers](https://developers.facebook.com/)
2. Create a new app or use an existing one
3. Add "Facebook Login" product to your app
4. Configure your OAuth redirect URIs in Facebook Login settings:
- Add your Supabase project's Facebook OAuth callback URL
- Format: `https://[your-project-ref].supabase.co/auth/v1/callback`

### 2. Supabase Configuration

1. Go to your Supabase project dashboard
2. Navigate to Authentication > Providers
3. Enable Facebook provider
4. Enter your Facebook App ID and App Secret
5. Configure the redirect URL if needed

### 3. Flutter App Configuration

#### Android Configuration

The following files have been configured for you:

1. **AndroidManifest.xml** - Contains Facebook SDK configuration
2. **strings.xml** - Contains placeholder values for Facebook credentials

You need to update the following values in `android/app/src/main/res/values/strings.xml`:

```xml
<string name="facebook_app_id">YOUR_ACTUAL_FACEBOOK_APP_ID</string>
<string name="facebook_client_token">YOUR_ACTUAL_FACEBOOK_CLIENT_TOKEN</string>
<string name="fb_login_protocol_scheme">fbYOUR_ACTUAL_FACEBOOK_APP_ID</string>
```

#### iOS Configuration

The following files have been configured for you:

1. **Info.plist** - Contains Facebook SDK configuration

You need to update the following values in `ios/Runner/Info.plist`:

```xml
<key>FacebookAppID</key>
<string>YOUR_ACTUAL_FACEBOOK_APP_ID</string>
<key>FacebookClientToken</key>
<string>YOUR_ACTUAL_FACEBOOK_CLIENT_TOKEN</string>
```

And update the URL scheme:
```xml
<string>fbYOUR_ACTUAL_FACEBOOK_APP_ID</string>
```

## Getting Your Facebook Credentials

### App ID
1. Go to Facebook Developers Console
2. Select your app
3. Go to Settings > Basic
4. Copy the "App ID"

### Client Token
1. In the same Basic settings page
2. Copy the "Client Token"
3. If you don't see it, you may need to generate one

## Testing

1. Replace all placeholder values with your actual Facebook credentials
2. Run `flutter pub get` to install dependencies
3. Run the app and test the "Continue with Facebook" button
4. Ensure your Facebook app is configured to allow the bundle ID/package name of your Flutter app

## Troubleshooting

- **Android**: Make sure your package name in `android/app/build.gradle` matches what's configured in Facebook
- **iOS**: Make sure your bundle identifier matches what's configured in Facebook
- **Both platforms**: Ensure your Facebook app is not in "Development Mode" if testing with non-developer accounts
- Check that your Supabase Facebook OAuth configuration matches your Facebook app settings

## Security Notes

- Never commit real Facebook credentials to version control
- Consider using environment variables or secure configuration management
- Regularly rotate your Facebook Client Token
24 changes: 21 additions & 3 deletions packages/supabase_flutter/example/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
# Profile Example
# Supabase Flutter Examples

Basic example of how to signup/login using Supabase auth and read and write from your Supabase
database.
Comprehensive examples showcasing the Supabase Flutter library features including authentication, database operations, realtime subscriptions, and file storage.

## Features Included

- **Authentication**: Sign up, sign in, social login (Facebook), password reset, and session management
- **Database**: CRUD operations with PostgreSQL database
- **Realtime**: Listen to database changes in real-time using WebSocket connections
- **Storage**: File upload, download, and management functionality

## Getting Started

1. Set up your Supabase project at [https://supabase.com](https://supabase.com)
2. Copy your project URL and anon key
3. Set environment variables or update the default values in `lib/main.dart`:
```
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
```
4. Run the SQL setup below in your Supabase SQL editor
5. For Facebook authentication, follow the Facebook auth setup guide

## SQL

Expand Down
6 changes: 3 additions & 3 deletions packages/supabase_flutter/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ android {
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_11.toString()
}

defaultConfig {
Expand Down
32 changes: 32 additions & 0 deletions packages/supabase_flutter/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
PODS:
- app_links (0.0.2):
- Flutter
- FBAEMKit (18.0.0):
- FBSDKCoreKit_Basics (= 18.0.0)
- FBSDKCoreKit (18.0.0):
- FBAEMKit (= 18.0.0)
- FBSDKCoreKit_Basics (= 18.0.0)
- FBSDKCoreKit_Basics (18.0.0)
- FBSDKLoginKit (18.0.0):
- FBSDKCoreKit (= 18.0.0)
- Flutter (1.0.0)
- flutter_facebook_auth (7.1.2):
- FBSDKLoginKit (~> 18.0.0)
- Flutter
- flutter_secure_storage (6.0.0):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -14,15 +27,28 @@ PODS:
DEPENDENCIES:
- app_links (from `.symlinks/plugins/app_links/ios`)
- Flutter (from `Flutter`)
- flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)

SPEC REPOS:
trunk:
- FBAEMKit
- FBSDKCoreKit
- FBSDKCoreKit_Basics
- FBSDKLoginKit

EXTERNAL SOURCES:
app_links:
:path: ".symlinks/plugins/app_links/ios"
Flutter:
:path: Flutter
flutter_facebook_auth:
:path: ".symlinks/plugins/flutter_facebook_auth/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
shared_preferences_foundation:
Expand All @@ -32,7 +58,13 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
app_links: f3e17e4ee5e357b39d8b95290a9b2c299fca71c6
FBAEMKit: e34530df538b8eb8aeb53c35867715ba6c63ef0c
FBSDKCoreKit: d3f479a69127acebb1c6aad91c1a33907bcf6c2f
FBSDKCoreKit_Basics: 017b6dc2a1862024815a8229e75661e627ac1e29
FBSDKLoginKit: 5875762d1fe09ddcb05d03365d4f5dc34413843d
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_facebook_auth: fa503a7103e482577bf50694ceefe6b61a78ef1a
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
791A11FE2E5F507C006859F5 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
89CEA82799D734CC486F5D5A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -68,7 +69,6 @@
9F7A42A0F8397A30C48EF6B6 /* Pods-Runner.release.xcconfig */,
FC8416E7A50F84EA287634DD /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -113,6 +113,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
791A11FE2E5F507C006859F5 /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -358,6 +359,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand Down Expand Up @@ -486,6 +488,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -508,6 +511,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand Down
36 changes: 36 additions & 0 deletions packages/supabase_flutter/example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,41 @@
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>

<!-- Facebook Configuration -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>facebook-login</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fbYOUR_FACEBOOK_APP_ID</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>YOUR_FACEBOOK_APP_ID</string>
<key>FacebookClientToken</key>
<string>YOUR_FACEBOOK_CLIENT_TOKEN</string>
<key>FacebookDisplayName</key>
<string>Supabase Flutter Example</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131024</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api</string>
<string>fb-messenger-share-api</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array/>
</dict>
</plist>
Loading
Loading