Flutter Integration
Feeddo allows you to drop a live AI support chat into your Flutter app with just 2 lines of code.
Installation
Section titled “Installation”Add feeddo_flutter to your pubspec.yaml:
dependencies: feeddo_flutter: ^0.1.2Then install the package:
flutter pub getiOS Setup
Section titled “iOS Setup”Feeddo requires a minimum deployment target of iOS 15.0.
-
Open your project in Xcode (open
ios/Runner.xcworkspace). -
Select the Runner project in the left navigation panel.
-
In the project targets list, select Runner.
-
Select the General tab.
-
In the Deployment Info section, set Minimum Deployments to 15.0.
-
Ensure your
ios/Podfilealso specifies platform 15.0:platform :ios, '15.0'
Quick Start
Section titled “Quick Start”1. Get Your API Key
Section titled “1. Get Your API Key”Sign up at feeddo.dev and grab your API key from the dashboard.
2. Initialize Feeddo
Section titled “2. Initialize Feeddo”Call Feeddo.init() when your app starts (usually in your main screen or main.dart).
import 'package:feeddo_flutter/feeddo_flutter.dart';
// ... inside your widget or initialization logicawait Feeddo.init( apiKey: 'your-api-key-here', context: context,);3. Show the Support Chat
Section titled “3. Show the Support Chat”Add a button anywhere in your app to open the support widget:
ElevatedButton( onPressed: () { Feeddo.show(context); }, child: Text('Get Help'),)4. Show the Community Board
Section titled “4. Show the Community Board”To show feature requests and bug reports directly:
ElevatedButton( onPressed: () { Feeddo.showCommunityBoard(context); }, child: Text('Request a feature'),)Configuration
Section titled “Configuration”The init() method supports various parameters to customize the user experience.
await Feeddo.init( apiKey: 'your-api-key', context: context,
// User identification externalUserId: 'user_12345', userName: 'John Doe',
// Segmentation userSegment: 'premium', subscriptionStatus: 'active',
// Custom data customAttributes: { 'plan': 'pro', 'country': 'US', },
// Notifications isInAppNotificationOn: true, pushToken: 'fcm-token-here', pushProvider: FeeddoPushProvider.fcm,);Notifications
Section titled “Notifications”Push Notifications Setup
Section titled “Push Notifications Setup”1. Configure App & Dashboard
To allow Feeddo to send push notifications, you need to provide your Firebase Service Account credentials:
- Go to the Firebase Console > Project Settings > Service accounts.
- Click Generate new private key to download the JSON file.
- Go to feeddo.dev, select your app, and navigate to Settings > Notifications.
- Select Google (FCM) and upload the JSON file (or paste its contents).
If you haven’t set up push notifications in your Flutter app yet, follow the Firebase Cloud Messaging Get Started guide.
2. Register Your Token
To get notifications even when the app is closed, register your push token:
String? token = await FirebaseMessaging.instance.getToken();// When you get the FCM tokenawait Feeddo.registerPushToken( pushToken: token, pushProvider: FeeddoPushProvider.fcm, // or .apns, .onesignal);Or pass it directly to init():
await Feeddo.init( apiKey: 'your-api-key', context: context, pushToken: 'your-push-token', pushProvider: FeeddoPushProvider.fcm,);Handle incoming messages:
// Background/TerminatedFirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) { Feeddo.handleNotificationTap(context, message.data);});
// ForegroundFirebaseMessaging.onMessage.listen((RemoteMessage message) { Feeddo.showInappNotification( context: context, title: message.notification?.title ?? 'New Message', message: message.notification?.body ?? '', data: message.data, );});Customization
Section titled “Customization”You can customize the look and feel using FeeddoTheme.
Basic Themes
Section titled “Basic Themes”// Dark themeFeeddo.show(context, theme: FeeddoTheme.dark());
// Light themeFeeddo.show(context, theme: FeeddoTheme.light());Custom Colors
Section titled “Custom Colors”final myTheme = FeeddoTheme( isDark: true, colors: FeeddoColors( background: Color(0xFF1A1A2E), textPrimary: Color(0xFFFFFFFF), primary: Color(0xFF00D9FF), // ... customized colors ),);
Feeddo.show(context, theme: myTheme);Others
Section titled “Others”Unread Message Count
Section titled “Unread Message Count”int unreadCount = Feeddo.unreadMessageCount;Update User Info
Section titled “Update User Info”await Feeddo.updateUser( userName: 'Jane Smith',);